From: Kern Sibbald Date: Wed, 23 Jun 2010 06:26:29 +0000 (+0200) Subject: Skip HB kill in FD if HB thread terminated X-Git-Tag: Release-5.2.1~1244 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8a5be33717c629de02036b2f7e95e1e9bd1d4951;p=bacula%2Fbacula Skip HB kill in FD if HB thread terminated --- diff --git a/bacula/src/filed/heartbeat.c b/bacula/src/filed/heartbeat.c index d50eec17ea..7141931201 100644 --- a/bacula/src/filed/heartbeat.c +++ b/bacula/src/filed/heartbeat.c @@ -139,9 +139,11 @@ void stop_heartbeat_monitor(JCR *jcr) jcr->hb_dir_bsock->set_timed_out(); /* set timed_out to terminate read */ jcr->hb_dir_bsock->set_terminated(); /* set to terminate read */ } - Dmsg0(100, "Send kill to heartbeat id\n"); - pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */ - bmicrosleep(0, 50000); + if (jcr->hb_started) { + Dmsg0(100, "Send kill to heartbeat id\n"); + pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */ + bmicrosleep(0, 50000); + } cnt = 0; /* Wait max 100 secs for heartbeat thread to stop */ while (jcr->hb_started && cnt++ < 200) {