From 7d9a744e262da77ff4467ae178836d265cb7bc96 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 23 Nov 2012 17:30:15 +0100 Subject: [PATCH] Add workaround for #5507 where autoprune and reload are in deadlock --- bacula/src/dird/ua_prune.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); -- 2.39.5