Extended 'is_job_canceled()' helper to check for the Incomplete state.
This way, handling job which was either stopped or cancelled is more
elegant (e.g. it is now possible to stop job which was waiting on
mounting volume during backup - it was not possilbe before).
#define job_canceled(jcr) \
(jcr->JobStatus == JS_Canceled || \
+ jcr->JobStatus == JS_Incomplete || \
jcr->JobStatus == JS_ErrorTerminated || \
jcr->JobStatus == JS_FatalError \
)
continue;
}
+ if (stat == W_WAKE) {
+ /* Job could be marked to stopped, need to break */
+ Mmsg0(dev->errmsg, _("Job was stopped by the user.\n"));
+ Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
+ Dmsg1(dbglvl, "Job marked to be stopped. Gave up waiting on device %s\n", dev->print_name());
+ dev->poll = false;
+ return false;
+ }
+
if (stat == W_TIMEOUT) {
if (!double_dev_wait_time(dev)) {
Mmsg(dev->errmsg, _("Max time exceeded waiting to mount Storage Device %s for Job %s\n"),