fix(Session): avoid race conditions on clustered setups#46398
Merged
Conversation
Member
Author
|
/backport to stable29 |
Member
Author
|
/backport to stable28 |
Member
Author
|
/backport to stable27 |
- re-stablishes old behaviour with cache to return null instead of throwing an InvalidTokenException when the token is cached as non-existing - token invalidation and re-generation are bundled in a DB transaction now Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
346e5c6 to
6a783d9
Compare
blizzz
commented
Jul 10, 2024
| $this->atomic(function () use ($sessionId, $uid, $loginName, $pwd, $name, $remember) { | ||
| $this->tokenProvider->invalidateToken($sessionId); | ||
| $this->tokenProvider->generateToken($sessionId, $uid, $loginName, $pwd, $name, IToken::TEMPORARY_TOKEN, $remember); | ||
| }, \OCP\Server::get(IDBConnection::class)); |
Member
Author
There was a problem hiding this comment.
ℹ️ cannot be passed as early dependency in the constructor, it would break setup.
prefer to keep this check as PublicEmitter should be dropped sooner or later Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
juliusknorr
approved these changes
Jul 10, 2024
Member
juliusknorr
left a comment
There was a problem hiding this comment.
That sounds reasonable and would safeguard if a second request would try to get the token between the delete and insert of the first request. 👍
|
We manually applied your proposal to our test platform on version 29.0.3, and it appears to effectively resolve our looping issue after authentication with user_saml as explained in #46165 |
Member
Author
|
Cypress is unrelated and fixed with #46428 → merge |
2 tasks
Merged
Merged
This was referenced Jul 11, 2024
Closed
8 tasks
This was referenced Jul 18, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Maybe that is not the final solution to this problem.
Checklist