From d3bdd873b38df4e20aa2272d2c0102c371f033fb Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 23 Jun 2010 08:26:29 +0200 Subject: [PATCH] Skip HB kill in FD if HB thread terminated --- bacula/src/filed/heartbeat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) { -- 2.39.5