ensure timeouts with sub-ms resolution don't occur early and hang#48284
Merged
ensure timeouts with sub-ms resolution don't occur early and hang#48284
Conversation
clintjedwards
approved these changes
Oct 29, 2025
serra-fastly
pushed a commit
that referenced
this pull request
Nov 17, 2025
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.
This corrects the rounding of
Durationvalues inReactor. Internally,Reactoruses a clock with 10ms "ticks", and when a timer is registered to expire after a givenDuration, the value needs to be rounded up to the nearest tick. Currently, before rounding up,as_millis()is called which rounds down to the nearest millisecond. This means that while 11ms correctly rounds to 2 ticks, 10.1ms incorrectly rounds to 1 tick. With the fix, 10.1ms correctly rounds to 2 ticks.Additionally,
Timeoutis reworked to panic if a timer notification occurs before enough time has passed. This way, a rounding bug like the one inReactorcan be immediately caught rather than silently result in a timeout never completing.