-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
protect overflow when computing expiration #56
Conversation
This change protects against overflow using 2 measures: 1. cache builders now won't build caches with time_tolive or time_to_idle higher than 1000 years. 2. for future computations, the internal Instant type will now only allow checked additions to force handling a possible overflow. in addition, an overflow is now an explicit panic instead of a silent overflow.
@tatsuya6502 can you help here?
fails here since the new code is located at |
The Lines 7 to 13 in 1074082
However, by a historical reason, these two source files ( pub(crate) type Instant = quanta::Instant;
pub(crate) type Clock = quanta::Clock;
#[cfg(test)]
pub(crate) type Mock = quanta::Mock; Let's clean them up now. You can remove them from these source files, and put them to |
Or maybe rename the current #[cfg_attr(feature = "atomic64", path = "common/time_atomic64.rs")]
#[cfg_attr(not(feature = "atomic64"), path = "common/time_compat.rs")]
- pub(crate) mod time;
+ pub(crate) mod atomic_time; and delete Then create |
For the Rustfmt warnings, please do the followings:
|
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.
LGTM. Thanks a lot for your contribution!
I will take care of the Rustfmt diffs after merging.
Hi @barkanido, I noticed you are not on our contributors page. I wish everybody who contributed to this project should be on the page to get some credits. I think this is because GitHub cannot locate your account from the email address used by your commits. As you can see, your name is not clickable on the list of your commits here, but my name (GitHub user name) is clickable on my commits here. I think you will need to go to GitHub's settings -> email page, and add your email address there if you have not. Thanks! |
done. Thanks @tatsuya6502 the commits are now clickable. the contributors' page is still not updated though. maybe it take time, idk. |
Hi @barkanido, Thanks for updating your setting. I wrote to the GitHub support and told that the contributors' page was not updated. They fixed the problem by re-indexing the data. Now you are on the page! From the GitHub support:
|
This change protects against overflow using 2 measures:
time_to_idle higher than 1000 years.
allow checked additions to force handling a possible overflow. in
addition, an overflow is now an explicit panic instead of a silent
overflow.
closes #52