Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handling of remaining jobs when using --keep-going #1693

Merged
merged 3 commits into from May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions snakemake/scheduler.py
Expand Up @@ -404,7 +404,9 @@ def remaining_jobs(self):
return [
job
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):
logger.error(_ERROR_MSG_FINAL)
# 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:
logger.error(_ERROR_MSG_ISSUE_823)
logger.error(
"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:
logger.info("Trying to restart job {}.".format(self.dag.jobid(job)))
logger.info(f"Trying to restart job {self.dag.jobid(job)}.")
job.attempt += 1
# add job to those being ready again
self.dag._ready_jobs.add(job)
else:
self._errors = True
self.failed.add(job)
if self.keepgoing:
logger.info("Job failed, going on with independent jobs.")

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