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: Repair MREs from #823 #1203

Merged
merged 12 commits into from Feb 21, 2022
19 changes: 18 additions & 1 deletion snakemake/scheduler.py
Expand Up @@ -43,6 +43,11 @@ def cumsum(iterable, zero=[0]):
"Exiting because a job execution failed. " "Look above for error message"
)

_ERROR_MSG_ISSUE_823 = (
"BUG: Out of jobs ready to be started, but not all files built yet."
" Please check https://github.com/snakemake/snakemake/issues/823 for more information."
)


class DummyRateLimiter(ContextDecorator):
def __enter__(self):
Expand Down Expand Up @@ -470,11 +475,23 @@ def schedule(self):
return False
continue

# normal shutdown because all jobs have been finished
# all runnable jobs have finished, normal shutdown
if not needrun and (not running or self.workflow.immediate_submit):
self._executor.shutdown()
if errors:
logger.error(_ERROR_MSG_FINAL)
# we still have unfinished jobs. this is not good. direct
# user to github issue
if self.remaining_jobs:
logger.error(_ERROR_MSG_ISSUE_823)
logger.error(
"Remaining jobs:\n"
+ "\n".join(
" - " + str(job) + ": " + ", ".join(job.output)
for job in self.remaining_jobs
)
)
return False
return not errors

# continue if no new job needs to be executed
Expand Down
9 changes: 9 additions & 0 deletions tests/test_issue823_3/Snakefile
@@ -0,0 +1,9 @@
rule all:
input:
"a.txt"

checkpoint a:
output:
"a.txt"
shell:
"touch {output}"
Empty file.
5 changes: 5 additions & 0 deletions tests/tests.py
Expand Up @@ -887,6 +887,11 @@ def test_issue823_2():
run(dpath("test_issue823_2"))


@skip_on_windows
def test_issue823_3():
run(dpath("test_issue823_3"))


@skip_on_windows
def test_pathlib():
run(dpath("test_pathlib"))
Expand Down