-
Notifications
You must be signed in to change notification settings - Fork 453
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
catches exceptions and logs when planning compactions #4435
catches exceptions and logs when planning compactions #4435
Conversation
String cacheKey = tablet.getTableId() + " " + e.getClass().getName(); | ||
// This check defends against every tablet in a table having the same problem and therefore | ||
// generating an enormous amount of spam for the logs. | ||
var last = generateJobsErrorCache.getIfPresent(cacheKey); |
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.
I think you might be able to just call Cache.get(Key,Function)
here and last
will be null
if it doesn't exist.
var last = generateJobsErrorCache.getIfPresent(cacheKey); | |
if (generateJobsErrorCache.get(cacheKey, () -> System.currentTimeMillis) == null) { |
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.
Looking at the docs for get it will return the computed value if absent. Can get the prev value w/ putIfAbsent. Made that change in d246ee8
"Failed to generate compaction jobs for {}. Other tablets may be experiencing the" | ||
+ " same error, this log message is temporarily suppressed for the entire table.", | ||
tablet.getExtent(), e); | ||
generateJobsErrorCache.put(cacheKey, System.currentTimeMillis()); |
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.
Remove this if you apply my suggestion above.
generateJobsErrorCache.put(cacheKey, System.currentTimeMillis()); |
Closing in favor of #4586 |
No description provided.