-
Couldn't load subscription status.
- Fork 140
Remove RetryLoopCas since RetryLoop behaves identically #7823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the duplicate RetryLoopCas function since RetryLoop now behaves identically after a previous commit. This cleanup eliminates redundant code while maintaining the same functionality.
- Removes the
RetryLoopCasfunction andRetryCasWorkertype definition fromutil.go - Updates all call sites to use the generic
RetryLoopfunction instead - Improves documentation comments for sleeper functions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| base/util.go | Removes duplicate RetryLoopCas function, RetryCasWorker type, and improves function documentation comments |
| base/collection_xattr_common.go | Updates all RetryLoopCas calls to use RetryLoop instead |
| base/collection_xattr.go | Updates all RetryLoopCas calls to use RetryLoop instead |
|
|
||
| // Kick off retry loop | ||
| err, cas = RetryLoopCas(ctx, "WriteTombstoneWithXattrs", worker, DefaultRetrySleeper()) | ||
| err, cas = RetryLoop(ctx, "WriteTombstoneWithXattrs", worker, DefaultRetrySleeper()) |
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call expects a RetryWorker[T] that returns (shouldRetry bool, err error, value T), but the worker variable appears to be defined as a RetryCasWorker that returns (shouldRetry bool, err error, value uint64). The worker function definition needs to be updated to match the generic RetryWorker[uint64] signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what this is asking for.
This reverts commit 7d685c1.
Remove RetryLoopCas since RetryLoop behaves identically since cb348a8
Allows removing duplicate code.