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

docs issue or regression? retries ignored #2047

Closed
ptrebert opened this issue Jan 5, 2023 · 1 comment · Fixed by #2053
Closed

docs issue or regression? retries ignored #2047

ptrebert opened this issue Jan 5, 2023 · 1 comment · Fixed by #2053
Assignees
Labels
bug Something isn't working

Comments

@ptrebert
Copy link

ptrebert commented Jan 5, 2023

Snakemake version
7.19.1

Describe the bug
The rule-specific retries directive is ignored.

Minimal example

rule foo:
    output:
        "foofile.txt"
    retries: 0
    run:
        print("running")

Running the above with

snakemake -c1 -d wd/ --restart-times 5

will restart the failed rule 5 times.

Additional context
The way I understand the documentation ...

Note that it is also possible to define retries globally (via the --retries command line option). The local definition of the rule thereby overwrites the global definition.

the retries directive in a rule should always take precedence.

This is related to #1649 (and somewhat to #367 and #500)

@ptrebert ptrebert added the bug Something isn't working label Jan 5, 2023
@pvandyken
Copy link
Contributor

This is a bug. The current implementation is not correctly handling retries: 0. Compare to an identical reprex where retries is set to 1.

Interestingly, such an experiment reveals a second bug, specifically related to the use of the run directive. Snakemake evaluates such rules in a subsnakemake instance, but the retries directive is getting honoured both within the parent and child snakemake instances, leading to 3 retries in total.

I'll create a new issue for the second bug, using the adapted minimal example.

pvandyken added a commit to pvandyken/snakemake that referenced this issue Jan 7, 2023
The retries property of each rule was being set via the cli flag
whenever the retries directive was falsy. This was leading `retries: 0`
to be incorrectly overriden.

Fix by explicitely checking for None

Resolves snakemake#2047
pvandyken added a commit to pvandyken/snakemake that referenced this issue Jan 7, 2023
The retries property of each rule was being set via the cli flag
whenever the retries directive was falsy. This was leading `retries: 0`
to be incorrectly overriden.

Fix by explicitely checking for None

Resolves snakemake#2047
pvandyken added a commit to pvandyken/snakemake that referenced this issue Jan 7, 2023
The retries property of each rule was being set via the cli flag
whenever the retries directive was falsy. This was leading `retries: 0`
to be incorrectly overridden.

Fix by explicitly checking for None

Resolves snakemake#2047
@pvandyken pvandyken self-assigned this Jan 7, 2023
johanneskoester pushed a commit that referenced this issue Jan 10, 2023
The retries property of each rule was being set via the cli flag
whenever the retries directive was falsy. This was leading `retries: 0`
to be incorrectly overridden.

Fix by explicitly checking for None

Resolves #2047

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants