-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] Error c.m.a.m.CrossProcessCacheFileLock when using tokenCachePErsistenceOptions #28186
Comments
I have the same issue. |
@xchopin, I guess that you infer the cache mechanism is failed from the log |
Hi @Kelukin thank you for your investigation on the issue. From what I understand, the cache system works and it's only a log issue from the SDK. Looking forward for a fix on that. Thank you! |
The logging here is indicating that |
Maybe more useful logging would be better than just logging the exception message. In this case, the message is null and that's not helpful at all. |
For example, the exception thrown is ClosedChannelException. That gives you a good hint that the following check is not enough: private void releaseResources() {
try {
if (lock != null) {
lock.release();
}
if (fileChannel != null) {
fileChannel.close();
}
}
catch (IOException ex){
LOG.error(ex.getMessage());
}
} The null guards should be enhanced to check validity as well: lock != null && lock.isValid() fileChannel != null && fileChannel.isOpen() edit: To address the source of the issue, you can turn on debug logging and see the unlock is being called twice:
The second release fails because it's already been released. |
Describe the bug
Impossible to use tokenCachePersistenceOptions() in my ClientSecretCredentialBuilder in order to cache the token (for making several requests with ONE token).
Exception or Stack Trace
To Reproduce
Create a ClientSecretCredentialBuilder and try adding the method .tokenCachePersistenceOptions()
Code Snippet
Expected behavior
It should cache the token and not calling getToken over and over
Setup (please complete the following information):
Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: