Skip to content
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

Does not have concurrency control (locking or optimistic) so race conditions are possible #80

Open
a3kov opened this issue May 6, 2017 · 0 comments

Comments

@a3kov
Copy link

a3kov commented May 6, 2017

I see no sign of locking here. Session is a shared resource. To avoid losing data and to have predictable results, concurrency control is needed. In the case of Redis it means you need to use locking, so that parallel requests using same session don't overwrite each other's session data.
Google "session race condition" to get plenty of information on this topic.

The irony of the fact is using exclusive locks partly defeats the whole idea of using fast session backend such as Redis: with locking parallel requests will effectively wait in a queue. But of course this will only affect same session requests. This is one of the reasons why I think database-backed sessions are not such a bad idea after all. Atleast, when we will have pyramid_retry finally working.

@a3kov a3kov changed the title Does not have concurrency control (locking) so race conditions are possible Does not have concurrency control (locking or optimistic) so race conditions are possible Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant