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

Retry on timeout stops working when retry_on_exit_code is specified #145

Open
kdomenicucci-kg opened this issue Nov 21, 2024 · 0 comments
Open
Assignees

Comments

@kdomenicucci-kg
Copy link

kdomenicucci-kg commented Nov 21, 2024

Describe the bug

When both a timeout and retry_on_exit_code are specified, timeouts are not retried.

   - name: "Example"
      uses: nick-fields/retry@v3
      with:
        max_attempts: 2
        retry_on: any
        timeout_minutes: 10
        retry_on_exit_code: 2
        command: <COMMAND>

Expected behavior

If retry_on is set to any (timeout + error), and timeout_minutes and retry_on_exit_code have valid values specified, then both timeouts and specific exit codes should support retrying.

Implementation details

In the code, it looks like this happens because retry_on_exit_code is evaluated without considering whether the command has finished running. It could be that fixing this issue is as simple as checking that the command has finished executing before evaluating exit codes.

} else if (done && inputs.retry_on_exit_code && inputs.retry_on_exit_code !== exit) {

Screenshot 2024-11-21 at 10 26 44 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants