Skip to content


Browse files Browse the repository at this point in the history
fix: handling of remaining jobs when using --keep-going (#1693)
* fix: proper handling of remaining jobs in case of keepgoing behavior

* syntax
  • Loading branch information
johanneskoester committed May 31, 2022
1 parent fdfc717 commit 87e4303
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions snakemake/
Expand Up @@ -404,7 +404,9 @@ def remaining_jobs(self):
return [
for job in self.dag.needrun_jobs()
if job not in self.running and not self.dag.finished(job)
if job not in self.running
and not self.dag.finished(job)
and job not in self.failed

def schedule(self):
Expand Down Expand Up @@ -451,7 +453,7 @@ def schedule(self):
# we still have unfinished jobs. this is not good. direct
# user to github issue
if self.remaining_jobs:
if self.remaining_jobs and not self.keepgoing:
"Remaining jobs:\n"
Expand Down Expand Up @@ -609,15 +611,13 @@ def _handle_error(self, job):
# attempt starts counting from 1, but the first attempt is not
# a restart, hence we subtract 1.
if job.restart_times > job.attempt - 1:"Trying to restart job {}.".format(self.dag.jobid(job)))"Trying to restart job {self.dag.jobid(job)}.")
job.attempt += 1
# add job to those being ready again
self._errors = True
if self.keepgoing:"Job failed, going on with independent jobs.")

def exit_gracefully(self, *args):
with self._lock:
Expand Down

0 comments on commit 87e4303

Please sign in to comment.