v1.0.2
What's Changed
A step would retry for all errors for MaxRunAttempts even when step moved out of Error State.
Cause
shouldRetry
returns true ifstep.StepOpts.RetryAllErrors
is set to true, without checking ifstep.stepResult.StepState
is in Error state.
if step.StepOpts.RetryAllErrors {
return true
}
Fix
- Adding check for
step.stepResult.StepState
to be StepStateError in addition to the RetryAllErrors fixes this bug.
if step.stepResult.StepState == StepStateError && step.StepOpts.RetryAllErrors {
return true
}
In addition step.StepOpts.MaxRunAttempts == step.stepRunProgress.runCount
has been removed from shouldExit
This pull request includes changes to the go_steps.go
file to enhance the retry and exit logic for steps. The most important changes include adding a condition to check the step state before retrying and refactoring the exit logic to use a switch statement.
Enhancements to retry logic:
go_steps.go
: Updated theshouldRetry
method to include a condition that checks if the step state isStepStateError
before retrying.
Refactoring exit logic:
go_steps.go
: Refactored theshouldExit
method to use a switch statement for better readability and removed the redundant return statement.
Full Changelog: v1.0.1...v1.0.2