What happened:
The codebase currently contains direct usages of the WaitNext function in the pkg/backoff package. There is a TODO comment at pkg/backoff/backoff.go:65 indicating that using WaitNext directly can lead to panics in certain scenarios, and we need to refactor these usages.
What you expected to happen:
To avoid potential panics and improve stability, all usages of WaitNext outside of the pkg/backoff package should be replaced with the safer Do method. The Do method encapsulates the retry logic and executes operations safely without risking panics from improper loop handling.
How to reproduce it:
This is a proactive code refactoring task rather than a runtime bug reproduction.
- Check
pkg/backoff/backoff.go line 65 to see the TODO.
- Search the codebase for invocations of
WaitNext(ctx) on retry interfaces/objects to see where refactoring is needed.
Environment:
piped version: N/A (Codebase refactoring)
control-plane version: N/A
- Others: N/A
What happened:
The codebase currently contains direct usages of the
WaitNextfunction in thepkg/backoffpackage. There is aTODOcomment atpkg/backoff/backoff.go:65indicating that usingWaitNextdirectly can lead to panics in certain scenarios, and we need to refactor these usages.What you expected to happen:
To avoid potential panics and improve stability, all usages of
WaitNextoutside of thepkg/backoffpackage should be replaced with the saferDomethod. TheDomethod encapsulates the retry logic and executes operations safely without risking panics from improper loop handling.How to reproduce it:
This is a proactive code refactoring task rather than a runtime bug reproduction.
pkg/backoff/backoff.goline 65 to see theTODO.WaitNext(ctx)onretryinterfaces/objects to see where refactoring is needed.Environment:
pipedversion: N/A (Codebase refactoring)control-planeversion: N/A