Skip to content

T 1532290: Back refreshClaimCoordinationEnabled with a lock for cross-thread runtime toggling - #176

Merged
vishal-mb merged 4 commits into
mainfrom
Task/1532290-Synchronize-refresh-claim-coordination-flag
Sep 1, 2026
Merged

vishal-mb merged 4 commits into
mainfrom
Task/1532290-Synchronize-refresh-claim-coordination-flag

Conversation

@vishal-mb

@vishal-mb vishal-mb commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Back refreshClaimCoordinationEnabled with 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.
  • Fix testBlockingTimeout flakiness. Blocking begin's semaphore and URLSession's task timeout both use timeoutIntervalForRequest and race, so the thrown error type depended on which fired first; URLError.timedOut is now normalized to .requestTimeout, and the test uses a stalled URLProtocol instead of a live server.

Test Plan

Full suite 231/231, SwiftLint 0 warnings; testBlockingTimeout deterministic across repeated runs.

Security Impact

No security impact — synchronization and error-normalization of existing behavior.

@AnshulMindbody AnshulMindbody left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
vishal-mb merged commit a2e9773 into main Sep 1, 2026
1 check passed
@vishal-mb
vishal-mb deleted the Task/1532290-Synchronize-refresh-claim-coordination-flag branch September 1, 2026 15:28
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