Skip to content
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

bugfix: cache get function, when in pin mode, should not increase the… #665

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

wxing1292
Copy link
Contributor

… counter before return

@wxing1292 wxing1292 requested review from mfateev and yiminc-zz April 13, 2018 03:03
if c.pin {
entry.refCount++
}

if c.isEntryExpired(entry, time.Now()) {
// Entry has expired
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. c.deleteInternal(element) apparently deletes the entry with associated refCount, so it doesn't matter if it is incremented or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then the question is why it wasn't found before? It looks like we don't have an expiration test on staging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/uber/cadence/pull/665/files#diff-15d63b195284f9a26bdbeb5e40398165R279
on the put side, the logic is sound.
hence, when the cache is full, the least used entry is deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moreover, there was test conducted in staging, testing the history service memory usage, since the put side logic is fine, this issue is not detected.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 64.831% when pulling 5f8ad70 on bugfix-cache into df48665 on master.

@wxing1292 wxing1292 merged commit 1bbf59c into master Apr 13, 2018
@wxing1292 wxing1292 deleted the bugfix-cache branch April 13, 2018 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants