Unify expiry condition in getWithInfo() and onEvict()#319
Merged
janisz merged 1 commit intoallegro:masterfrom Jun 14, 2022
Merged
Unify expiry condition in getWithInfo() and onEvict()#319janisz merged 1 commit intoallegro:masterfrom
janisz merged 1 commit intoallegro:masterfrom
Conversation
janisz
reviewed
May 24, 2022
Collaborator
|
@chen-zhuohan it looks like we have race now |
Contributor
Author
|
it seems be some problem about uint64(out of the uint64 limits). func (s *cacheShard) isExpired(oldestEntry []byte, currentTimestamp uint64) bool {
oldestTimestamp := readTimestampFromEntry(oldestEntry)
fmt.Println(time.Unix(int64(currentTimestamp), 0), time.Unix(int64(oldestTimestamp), 0), currentTimestamp-oldestTimestamp, s.lifeWindow, currentTimestamp-oldestTimestamp > s.lifeWindow)
return currentTimestamp-oldestTimestamp > s.lifeWindow
}I get this print: see 18446744073709551615, and the problem will be clean. I add another check to fix it. |
janisz
approved these changes
May 30, 2022
Contributor
Author
|
how long will the change merged QAQ @janisz |
Collaborator
|
@chen-zhuohan I'm sorry, I missed this. It's merged, thanks! |
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.
Closes: #318