Conversation
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
Demonstrate replacing the two
watch<()>notifications inMutationGateandShardControlwithAutoResetEventfrom apache/asyncband#310. The event prompts a recheck of the existing mutation count, drain generation, or failure state; synchronous waiters continue to use their condition variables.MutationDrainGuardexcludes concurrent drains and remains held across every asynchronous shard wait, so each event has at most one asynchronous observer. Retained signals cover completion between checking the predicate and registering a wait. Signals left by cancelled waits or older generations only cause an extra predicate check. Notifications still occur after releasing state locks.This removes watch subscriptions, unused values/versions, and sender-lifetime error handling. It targets the drain path; no throughput improvement is claimed. Multiple independent asynchronous observers would require reconsidering the primitive.
Design Notes
Cargo.toml and Cargo.lock pin the implementation at
085390437eba05a76efdcfd7e4388b1ea0023dbcin https://github.com/tisonkun/asyncband.git. A matching[patch.crates-io]in.cargo/config.tomlkeeps package verification on that revision when Cargo normalizes the dependency to a registry version. CI builds and verifies the generated package with the unreleased implementation; the source policy allows this repository for the demonstration.Before merging, switch to the released Asyncband version containing apache/asyncband#310 and remove the temporary Git pin, Cargo configuration patch, and Git-source allowance.
Validation:
cargo x check,cargo x test(including extended tests), and the completecargo x lintworkflow passed. Package metadata confirms that the generated package resolves Asyncband to the pinned Git revision. Deterministic tests cover exclusive drains, cancellation after signal assignment, retries, and stale drain generations.