Repository navigation
Conversation
This was referenced Oct 16, 2026
|
@quartzmo and @torreypayne I've left an internal message about what's expected from this. |
torreypayne
requested changes
Oct 23, 2026
| attr_reader :max_tokens | ||
| attr_reader :refill_ratio | ||
|
|
||
| alias enabled? enabled |
Member
There was a problem hiding this comment.
Between these two lines and L53-55, the naming between attributes and aliases is pretty confusing. More so code smell than poor implementation
|
|
||
| private | ||
|
|
||
| def Boolean value # rubocop:disable Naming/MethodName |
Member
There was a problem hiding this comment.
We'll need to modify this; capitalized Ruby methods are strongly discouraged (hence the rubocop:disable). It shouldn't be too difficult to modify this to a lowercased method.
| # @return [Boolean] true if a token was acquired, false otherwise. | ||
| # | ||
| def try_acquire_hedge_token | ||
| @mutex.synchronize do |
feywind
force-pushed
the
hedging/options-and-token-bucket
branch
from
October 28, 2026 18:55
aef4598 to
4b454ae
Compare
This branch has not been deployed
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.
Stack Structure (Stack #36644)
hedging/options-and-token-buckethedging/coordinator-and-schedulerhedging/queue-integrationhedging/queue-unit-testshedging/system-testsSummary
Implements Layer 1 of Cloud Pub/Sub Publish Hedging (
go/sdk:pubsub-hedging) forgoogle-cloud-pubsub:AsyncPublisher::HedgingOptions(lib/google/cloud/pubsub/async_publisher/hedging_options.rb):enabled: true,hedge_delay: 1.0,max_tokens: 50,refill_ratio: 0.1, plusdelayalias).0.1 <= hedge_delay <= 10.0, integer1 <= max_tokens <= 250,0.001 <= refill_ratio <= 0.2), mutual exclusion withmessage_ordering, andhedge_delay < publish_timeout.AsyncPublisher::HedgingTokenBucket(lib/google/cloud/pubsub/async_publisher/hedging_token_bucket.rb):1,000(1.0logical token =1,000scaled units) starting at0tokens on cold start.test/google/cloud/pubsub/async_publisher/hedging_token_bucket_test.rb):max_tokens, and multi-threaded concurrent stress testing.