-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not panic on timeout(Duration::MAX)
It is tempting to use very large `Duration` value to get a practically infinite timeout. Before this commit tokio panics on checked Instant + Duration overflow. This commit implements very simple fix: if Instant + Duration overflows, we use duration = 100 years. Better fix should avoid firing a timer on duration overflow. It requires deeper understanding how timers work, but also it is not clear, for example, what `Sleep::deadline` function should return. Similar fix is done for `sleep`.
- Loading branch information
1 parent
c9d2a36
commit b050097
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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