Repository navigation
T 1532290: Back refreshClaimCoordinationEnabled with a lock for cross-thread runtime toggling - #176
Merged
vishal-mb merged 4 commits intoSep 1, 2026
Conversation
…-thread runtime toggling
…e two timeout timers cannot race
AnshulMindbody
approved these changes
Sep 1, 2026
AnshulMindbody
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Both access paths use the same lock, and it is released before any refresh work or callbacks run, so the runtime toggle is race-free without introducing lock-order or reentrancy risk. The public API and default remain unchanged, and the timeout normalization matches the blocking API's documented contract. I ran all 231 tests locally and repeated the timeout test 20 times; everything passed.
vishal-mb
deleted the
Task/1532290-Synchronize-refresh-claim-coordination-flag
branch
September 1, 2026 15:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
refreshClaimCoordinationEnabledwith a lock. Hosts may toggle it at runtime while request pipelines read it from their own queues; a plain static Bool made that a data race. No API change.testBlockingTimeoutflakiness. Blockingbegin's semaphore and URLSession's task timeout both usetimeoutIntervalForRequestand race, so the thrown error type depended on which fired first;URLError.timedOutis now normalized to.requestTimeout, and the test uses a stalledURLProtocolinstead of a live server.Test Plan
Full suite 231/231, SwiftLint 0 warnings;
testBlockingTimeoutdeterministic across repeated runs.Security Impact
No security impact — synchronization and error-normalization of existing behavior.