-
Notifications
You must be signed in to change notification settings - Fork 59
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 hard limit for FastSerdeCache #82
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #82 +/- ##
=========================================
Coverage 53.52% 53.52%
Complexity 275 275
=========================================
Files 39 39
Lines 1659 1659
Branches 206 206
=========================================
Hits 888 888
Misses 689 689
Partials 82 82 Continue to review full report at Codecov.
|
LGMT. Thanks |
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.
Left some minor comments, and look good overall.
} | ||
this.generatedSerDesNum.incrementAndGet(); | ||
} catch (Exception e) { | ||
LOGGER.error("Fast serdes class generation failed"); |
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.
Shall we print out the full error stacktrace here?
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.
The exceptions are handled in other functions. So a stack trace here may not provide any useful information.
} else if (this.generatedSerDesNum.get() > this.generatedFastSerDesLimit) { | ||
LOGGER.debug("Generated serdes number {}, with fast serdes limit set to {}", this.generatedSerDesNum.get(), this.generatedFastSerDesLimit); | ||
} | ||
this.generatedSerDesNum.incrementAndGet(); |
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.
Race condition could happen here since the check and update are happening in different places.
I don't think it is a big concern considering the default thread pool size is 2, so in the worst scenario, the total number of the generated classes could be one more than the specified limit.
But it is good to call it out here, and we need to use AtomicInteger
here since there is no difference from an Integer
according to the actual usage.
8464663
to
36419bd
Compare
No description provided.