Skip to content

Conversation

@torcolvin
Copy link
Collaborator

Remove RetryLoopCas since RetryLoop behaves identically since cb348a8

Allows removing duplicate code.

@torcolvin torcolvin requested a review from gregns1 October 13, 2025 14:40
Copilot AI review requested due to automatic review settings October 13, 2025 14:40
Copy link
Contributor

Copilot AI left a 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 RetryLoopCas function and RetryCasWorker type definition from util.go
  • Updates all call sites to use the generic RetryLoop function 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())
Copy link

Copilot AI Oct 13, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

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.

@torcolvin torcolvin merged commit 7d685c1 into main Oct 23, 2025
57 of 59 checks passed
@torcolvin torcolvin deleted the remove-cas-specific branch October 23, 2025 13:00
torcolvin added a commit that referenced this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants