-
Notifications
You must be signed in to change notification settings - Fork 722
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
Ensure ROM class cache shutdown is necessary #18792
Ensure ROM class cache shutdown is necessary #18792
Conversation
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 change looks good, but I would use a different name for the variable that was introduced.
// Time for a purge operation. | ||
// Scan the entire table and delete old elements that are not in use | ||
for (auto iter = _clientSessionMap.begin(); iter != _clientSessionMap.end(); ++iter) | ||
{ | ||
TR_ASSERT(iter->second->getInUse() >= 0, "_inUse=%d must be positive\n", iter->second->getInUse()); | ||
clientWasDeleted = true; |
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.
Just because we enter this loop, it doesn't mean that the clients were deleted. It only means that client sessions exist. Thus, I would change the name of the variable.
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.
True. I also changed the logic slightly, hopefully to be a little clearer.
Signed-off-by: Christian Despres <[email protected]>
ee90a75
to
27b0507
Compare
jenkins test sanity zlinuxjit jdk17 |
In #18656, I did not check to see if any clients were actually deleted in the purge operation. If none were, then the shared ROM class cache would necessarily have been shut down already. Attempting to shut it down again would lead to a segfault. Checking if the purge operation was responsible for deleting the last clients before shutting down the shared ROM class cache avoids this issue.
Attn @mpirvu.