Is PersistedAccessTokenCache thread safe? #666
Replies: 1 comment 2 replies
-
Update: When playing around and trying to fix the CamundaCloudTokenProvider I found that apparently we can provide another TokenSupplier to the builder. It just has to implement the IAccessTokenSupplier interface. So we can use dotnet own libraries to fetch and cache the tokens. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
For me it seems that PersistedAccessTokenCache is not thread safe and when the token expires, multiple threads will try to update the saved file simultaneously. This is causing different errors in Windows and dockerized Linux environments.
On Windows machine I get
IOException: The process cannot access the file '...\\.zeebe\\credentials' because it is being used by another process.\
On Linux container its something like
Unauthenticated: Failed to parse bearer token, see cause for details
And the errors in the logs only pop up at the time when token is being updated.
Has anyone else experienced similar issue?
What could be the fix for it? Using Semaphore for the token update? Or maybe I have missed something with the setup?
Beta Was this translation helpful? Give feedback.
All reactions