Skip to content

Commit

Permalink
stored: fix corner-case crash during job cancel
Browse files Browse the repository at this point in the history
When jcr->store_bsock was null during job cancellation
the director would crash.

This patch was backported from commit d0d1ccb.
  • Loading branch information
arogge committed Mar 18, 2019
1 parent 5e09d53 commit e32e005
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dird/sd_cmds.c
Expand Up @@ -668,8 +668,10 @@ bool cancel_storage_daemon_job(UAContext *ua, JCR *jcr, bool interactive)
if (!interactive) {
jcr->sd_canceled = true;
}
jcr->store_bsock->set_timed_out();
jcr->store_bsock->set_terminated();
if (jcr->store_bsock) {
jcr->store_bsock->set_timed_out();
jcr->store_bsock->set_terminated();
}
sd_msg_thread_send_signal(jcr, TIMEOUT_SIGNAL);

/*
Expand Down

0 comments on commit e32e005

Please sign in to comment.