-
Notifications
You must be signed in to change notification settings - Fork 345
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
Fix severe peformance issue accessing keys #681
Fix severe peformance issue accessing keys #681
Conversation
The "true" in the call to Generation::create() in OSToken::OSToken() is used as the umask when it's supposed to be the isToken value (softhsm#566). Remove the default value from isToken because it's dangerous and there are only two callers. Explicitly pass "true" and "false" for isToken. Failing to consider this a token generation file means that the value is never refreshed for read-only operations. All objects are reloaded from disk every time one of them is refreshed. List operations take a long time because all of the objects are re-read for each object. Fixes softhsm#680.
|
@halderen it looks like you're nearing the point of making a release for other changes, could you merge this soon? |
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.
Its pretty obvious this is an argument handling mistake in the code. This PR fixes that and makes the function call more explicit.
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.
Looks good!
A fixup for #566.
Maybe there is clang-tidy checker that could have helped us catching this, implicit-bool-conversion might be to broad but maybe there is something else in that toolbox.
The "true" in the call to Generation::create() in OSToken::OSToken() is
used as the umask when it's supposed to be the isToken value (#566).
Remove the default value from isToken because it's dangerous and there are
only two callers. Explicitly pass "true" and "false" for isToken.
Failing to consider this a token generation file means that the value is
never refreshed for read-only operations. All objects are reloaded from
disk every time one of them is refreshed. List operations take a long time
because all of the objects are re-read for each object.
Fixes #680.