From: Eric Bollengier Date: Fri, 23 Nov 2012 16:30:15 +0000 (+0100) Subject: Add workaround for #5507 where autoprune and reload are in deadlock X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=485e437fa529bf0c2ed97b6e40cdf66cbfa0533a;p=bacula%2Fbacula Add workaround for #5507 where autoprune and reload are in deadlock --- diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index 68c747cfce..7380945a98 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -403,6 +403,9 @@ static int job_select_handler(void *ctx, int num_fields, char **row) struct accurate_check_ctx *res; ASSERT(num_fields == 6); + /* Quick fix for #5507, avoid locking res_head after db_lock() */ + +#ifdef bug5507 /* If this job doesn't exist anymore in the configuration, delete it */ if (GetResWithName(R_JOB, row[0]) == NULL) { return 0; @@ -417,6 +420,7 @@ static int job_select_handler(void *ctx, int num_fields, char **row) if (GetResWithName(R_CLIENT, row[2]) == NULL) { return 0; } +#endif /* Don't compute accurate things for Verify jobs */ if (*row[5] == 'V') { @@ -526,7 +530,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, POOL *pool, int JobType) /* The job_select_handler will skip jobs or filesets that are no longer * in the configuration file. Interesting ClientId/FileSetId will be - * added to jobids_check + * added to jobids_check (currently disabled in 6.0.7b) */ if (!db_sql_query(ua->db, query.c_str(), job_select_handler, jobids_check)) { ua->error_msg("%s", db_strerror(ua->db));