Repository navigation
refactor: unify async synchronization with AsyncBand - #870
Merged
Merged
Conversation
tisonkun
marked this pull request as ready for review
September 8, 2026 08:35
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
This PR standardizes async synchronization on AsyncBand across the workspace and eliminates duplicate concurrent Azure user delegation key requests by coalescing identical cache-miss fetches via singleflight.
Changes:
- Replace futures/Tokio sync primitives with
asyncbandequivalents (mutex, semaphore, oneshot) in Google CAB, core tests, WASM reqwest bridge, and Azure tests. - Add Azure singleflight coordination (
Group::try_work) keyed by cache identity + requested key start/expiry to prevent duplicate delegation key fetches. - Update crate feature flags/dependencies to remove replaced futures/futures-channel usage and enable required AsyncBand features.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/google/src/credential_access_boundary/client_side.rs | Switch CAB cache/refresh synchronization to asyncband::mutex::Mutex; update test gating to asyncband::semaphore::Semaphore. |
| services/google/Cargo.toml | Add optional asyncband dependency and dev feature for semaphore; remove optional futures dependency for CAB feature. |
| services/azure-storage/src/user_delegation_sas.rs | Add asyncband::singleflight::Group to coalesce delegation key requests; extend tests to cover coalescing, partitioning, retry behavior, and per-grant validation. |
| services/azure-storage/Cargo.toml | Add asyncband dependency with singleflight + dev semaphore. |
| core/src/signer.rs | Switch signer tests from futures::channel::oneshot to asyncband::oneshot. |
| core/Cargo.toml | Add dev-dependency on asyncband with oneshot feature for tests. |
| context/http-send-reqwest/src/lib.rs | Replace WASM bridge oneshot channel with asyncband::oneshot import. |
| context/http-send-reqwest/Cargo.toml | Replace wasm32-only futures-channel dependency with wasm32-only asyncband oneshot feature. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Reqsign uses Tokio and futures synchronization alongside AsyncBand, while concurrent Azure SAS cache misses can issue identical user delegation key requests. Use AsyncBand consistently for async synchronization and coalesce those Azure key requests.
asyncband::mutex::Mutex.Group::try_workfor Azure user delegation keys, partitioned by account, endpoint, source-token fingerprint, service version, and requested key start and expiry. Retain the bounded cache and per-grant SAS validity checks; waiting callers can retry after a failed or cancelled key request.Testing
The full workspace suite includes Google client-side CAB refresh sharing, partition isolation, and cancellation tests. The four Azure coordination tests pass; three reproduce duplicate requests against the original implementation. The existing WASM HTTP test also passes under Node with wasm-bindgen-test-runner 0.2.128.
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-features --no-fail-fast(including doc tests)cargo build --manifest-path reqsign/Cargo.toml --target wasm32-unknown-unknown --no-default-features --features default-context,aws,aws-v4a,azure,aliyun,tencentcargo test --target wasm32-unknown-unknown -p reqsign-http-send-reqwest --test wasmhawkeye checkRepository-wide scanning found no remaining direct uses of Tokio or futures synchronization primitives. Live cloud service tests were not run locally.
AI assisted with the implementation, tests, and PR draft.