Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, there was an issue where the agent could panic while attempting to determine if an error was temporary.
Before the change, in
agent/exec/errors.go
, the functionIsTemporary
attempted to drill down to a root cause by iterating through the causes of an error by callingerrors.Cause
. If an error has no cause, thenerrors.Cause
returns that same error.The issue is that somewhere in the depths of some code, it was possible for the error to have an underlying type that was non-comparable; for example, maps and slices are uncomparable types. This would cause a panic, as the uncomparable type cannot be compared even to itself.
However, one can see that
errors.Cause
has its own loop, and drills down to the root cause in its own way. There is no need for us to iterate here.Instead, we can just take a look at the error itself, and then take a look at its cause once. If neither is temporary, the error is not temporary, and we have nothing to worry about.