-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hedge: use auto-resizing histograms #484
Merged
Merged
Conversation
This file contains 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
Closes #475 |
The previous code used a fixed-size histogram with an upper bound of 10_000 ms (10s). This meant that the `Hedge` middleware would display errors when used with services that take longer than 10s to complete a response. Instead, use a constructor that produces an auto-resizing histogram. In the future, if the auto-resizing behavior is an issue, Tower could add a second constructor for the Hedge middleware that allows specifying bounds, but for now this change is transparent and avoids spurious errors.
hdevalence
force-pushed
the
hedge-resize
branch
from
November 19, 2020 00:10
9863b6f
to
42f6a78
Compare
the CI failure is spurious (looks like a tool could not be downloaded). i'll restart CI. |
hawkw
approved these changes
Nov 19, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good to me!
Ah, hmm, looks like the |
hdevalence
added a commit
to ZcashFoundation/zebra
that referenced
this pull request
Nov 19, 2020
hdevalence
added a commit
to ZcashFoundation/zebra
that referenced
this pull request
Nov 20, 2020
44 tasks
teor2345
added a commit
to teor2345/zebra
that referenced
this pull request
Feb 17, 2021
When other tower-batch tasks drop, wake any tasks that are waiting for a semaphore permit. Otherwise, tower-batch can hang. We currently pin tower in our workspace to: d4d1c67 hedge: use auto-resizing histograms (tower-rs/tower#484) Copy tower/src/semaphore.rs from that commit, to pick up tower-rs/tower#480.
dconnolly
pushed a commit
to ZcashFoundation/zebra
that referenced
this pull request
Feb 17, 2021
When other tower-batch tasks drop, wake any tasks that are waiting for a semaphore permit. Otherwise, tower-batch can hang. We currently pin tower in our workspace to: d4d1c67 hedge: use auto-resizing histograms (tower-rs/tower#484) Copy tower/src/semaphore.rs from that commit, to pick up tower-rs/tower#480.
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.
The previous code used a fixed-size histogram with an upper bound of 10_000 ms
(10s). This meant that the
Hedge
middleware would display errors when usedwith services that take longer than 10s to complete a response. Instead, use a
constructor that produces an auto-resizing histogram. In the future, if the
auto-resizing behavior is an issue, Tower could add a second constructor for
the Hedge middleware that allows specifying bounds, but for now this change is
transparent and avoids spurious errors.