Skip to content

Retry on timeout stops working when retry_on_exit_code is specified #145

@kdomenicucci-kg

Description

@kdomenicucci-kg

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions