From: Kern Sibbald Date: Mon, 15 Feb 2010 16:59:27 +0000 (+0100) Subject: Tweak add debug to duplicate-job X-Git-Tag: Release-5.2.1~1732 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aada196f3e01e33e5fd88a78a613ac27243ef628;p=bacula%2Fbacula Tweak add debug to duplicate-job --- diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index 591dc6fa4e..8b133c1960 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -135,6 +135,7 @@ bool job_cmd(JCR *jcr) free_jcr(ojcr); } jcr->JobId = JobId; + Dmsg2(800, "Start JobId=%d %p\n", JobId, jcr); jcr->VolSessionId = newVolSessionId(); jcr->VolSessionTime = VolSessionTime; bstrncpy(jcr->Job, job, sizeof(jcr->Job)); @@ -201,6 +202,7 @@ bool run_cmd(JCR *jcr) Dmsg3(50, "%s waiting %d sec for FD to contact SD key=%s\n", jcr->Job, (int)(timeout.tv_sec-time(NULL)), jcr->sd_auth_key); + Dmsg2(800, "Wait FD for jid=%d %p\n", jcr->JobId, jcr); /* * Wait for the File daemon to contact us to start the Job, @@ -213,17 +215,20 @@ bool run_cmd(JCR *jcr) if (errstat == ETIMEDOUT || errstat == EINVAL || errstat == EPERM) { break; } + Dmsg1(800, "=== Auth cond errstat=%d\n", errstat); } Dmsg3(50, "Auth=%d canceled=%d errstat=%d\n", jcr->authenticated, job_canceled(jcr), errstat); V(mutex); + Dmsg2(800, "Auth fail or cancel for jid=%d %p\n", jcr->JobId, jcr); memset(jcr->sd_auth_key, 0, strlen(jcr->sd_auth_key)); if (jcr->authenticated && !job_canceled(jcr)) { - Dmsg1(50, "Running job %s\n", jcr->Job); + Dmsg2(800, "Running jid=%d %p\n", jcr->JobId, jcr); run_job(jcr); /* Run the job */ } + Dmsg2(800, "Done jid=%d %p\n", jcr->JobId, jcr); return false; } @@ -362,7 +367,12 @@ bool query_cmd(JCR *jcr) */ void stored_free_jcr(JCR *jcr) { - Dmsg1(900, "stored_free_jcr JobId=%u\n", jcr->JobId); + Dmsg2(800, "End Job JobId=%u %p\n", jcr->JobId, jcr); + if (jcr->dir_bsock) { + Dmsg2(800, "Send terminate jid=%d %p\n", jcr->JobId, jcr); + jcr->dir_bsock->signal(BNET_EOD); + jcr->dir_bsock->signal(BNET_TERMINATE); + } if (jcr->file_bsock) { jcr->file_bsock->close(); jcr->file_bsock = NULL; diff --git a/regress/tests/duplicate-job-test b/regress/tests/duplicate-job-test index 045b300e2f..d050610aeb 100755 --- a/regress/tests/duplicate-job-test +++ b/regress/tests/duplicate-job-test @@ -46,6 +46,7 @@ messages @$out ${cwd}/tmp/log1.out messages label storage=File volume=TestVolume001 +@#setdebug level=100 storage=File @############################################## @# AllowDuplicates = Yes, both jobs should work @##############################################