You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
With some good debugging from Lei, it was discovered that we were getting errors during auth but that they were being lost.
The errors we now see indicate that during a read of the SSO cache, the JSON is malformed.
Solution:
A guess is that multiple writes to a file can happen at the same time.
To mitigate this, when writing cache we will make it more atomic by writing all the content to a temp file, then renaming the temp file to the actual target.
Now, if there is a race condition each write will either fully make it in or be overwritten by the following write. We should now avoid the malformed JSON.
Other findings:
If we do multiple token refreshes in rapid succession, both refreshed access tokens will be valid by the looks of it. I guess there isn't a max of 1 active token. So if we have a race condition for the last access token to be saved to cache it doesn't really matter.
Signed-off-by: Nikolas Komonen <[email protected]>
0 commit comments