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

Add a periodic cleanup thread for IndexFieldCache caches #7015

Merged
merged 1 commit into from Jul 24, 2014

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Jul 24, 2014

Defaults to every 10 minutes.

Fixes #7010

try {
// Each key in the cache contains an IndexFieldCache, so clean
// up each of the entries' caches
for (Key key : cache.asMap().keySet()) {
Copy link
Member

Choose a reason for hiding this comment

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

isn't Key#indexCache simply the same cache instance that we create on construction of IndicesFieldDataCache? We can just call cleanup once on the cache class, and then we are good?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh yea, I missed that it was threaded through and not a brand new cache, will fix.

@kimchy
Copy link
Member

kimchy commented Jul 24, 2014

LGTM, I wonder if we should be more aggressive with the interval? I think something like 60 seconds, specifically since it doesn't spawn another thread, would work well

@dakrone
Copy link
Member Author

dakrone commented Jul 24, 2014

Changing the interval to 1 minute.

@kimchy
Copy link
Member

kimchy commented Jul 24, 2014

LGTM

@dakrone dakrone merged commit 89e0391 into elastic:master Jul 24, 2014
@clintongormley clintongormley changed the title Add a periodic cleanup thread for IndexFieldCache caches Internal: Add a periodic cleanup thread for IndexFieldCache caches Sep 8, 2014
@dakrone dakrone deleted the add-cache-cleanup-thread branch September 9, 2014 13:49
@clintongormley clintongormley changed the title Internal: Add a periodic cleanup thread for IndexFieldCache caches Add a periodic cleanup thread for IndexFieldCache caches Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Look into adding a service that cleans Guava caches occasionally
3 participants