improve logs for retry.Do error scenarios(troubleshoting improvement)#1909
improve logs for retry.Do error scenarios(troubleshoting improvement)#1909
Conversation
|
👋 fernandezlautaro, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
📊 API Diff Results
|
There was a problem hiding this comment.
Pull request overview
Improves troubleshooting for pkg/utils/retry.Strategy.Do by ensuring terminal retry failures (context cancellation/timeout or max retries) include the last callback error in the returned error message, and updates tests accordingly.
Changes:
- Track and surface the last callback error in the
context doneandmax retry attempts reachederror paths. - Expand retry tests to assert the returned error contains both the retry wrapper error and the underlying callback error details.
- Add new test cases to validate that the last callback error is surfaced.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/utils/retry/retry.go | Adds lastKnownErr tracking and includes it in terminal error messages for better diagnostics. |
| pkg/utils/retry/retry_test.go | Updates error assertions to check multiple substrings and adds new cases around “last error” behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Several pieces in of the WR in CRE relies on the
retry.Dofeature, where when eventually fails the real cause gets swallowed here.So this fix improves readability when we are troubleshooting logs
Requires
Supports