-
Notifications
You must be signed in to change notification settings - Fork 392
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
Incorrect cache duration due to a precision issue. #118
Comments
Uint32 is not large enough to include milliseconds. |
Understood. Is it possible to change it to uint64? |
It is possible but maybe not worth to do so. |
Make sense. Sounds like a reasonable trade-off. Should it be documented somewhere? Btw why is it 8 bytes more instead of 4 bytes more? |
Each entry stores two Uint32 values, accessTime and expireAt. Yes, it could be documented, would you like to send a PR for it? |
sure thing: #119 |
Thank you for the help! |
Because internally the granulariry of expiration time is second, when the physical time is like xx::yy::zz.950 (950 ms passed for the second), and if we set a value with expiration of 1 second, the actual cache duration is only 50ms, instead of 1 second.
A test case to reproduce the issue:
Shall we consider to use milliseconds internally?
The text was updated successfully, but these errors were encountered: