-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Redis 6.0 issues with session locking #2382
Comments
Confirming, |
https://github.com/exussum12/redis-issue Repo above reproduces the issue Steps to reproduce.
The second one will fail to return the session id. Use exussum12/redis-issue@d9403bd to fall back to another version and the above returns with a session id Monitor mode shows no get is ever made https://github.com/exussum12/redis-issue/blob/master/5.3.7 vs |
687a0b4#diff-d7896829bc47f45d33720c352a4b8aabd4dca447b6db9e2d4205be5b44ba5d9eR714 Seems to be the issue it appears in the above changelog |
If a session lock fails to obtain, use a read only version of the session. This causes less backwards compatible issues and was introduced between the 5.3.7 and 6.0.0 releases. New note added to suggest the session is read only Fixes phpredis#2382
Same issue here upgrading to redis-ext 6 |
@michael-grunder any chance of taking a look at the attached pull request. Thanks |
any updates on this? thanks! |
@yatsukhnenko any chance you can check the PR please? |
@exussum12 I think you should adjust |
I do not really disagree on a high level. Its pushing the error to somewhere else. Backwards compatibility / documentation This is not documented behaviour though. 5.3.7 works as the PR attached. 6 fails all together. Its actually a hard error to spot and imagine there are people running into this issue without knowing. Other session handlers I also do not think that session handlers should put their own rules ontop of session_start. Tweaking behaviour sure (to speed up lock checks for example) but not to change the behaviour. Running the Repo above though other common session handlers gives the following results No error Error So memcached was the only exception before Redis 6 happened. Worth an ini opt in option for this major version and then going fully to this behaviour for next major version? |
@exussum12 Are you taking about #2386?
I agree we need to pay more attention to documenting changes
Files handler doesn't have the problem with locking because there's no timeout. You can simulate behaviour of files handler by setting very high value for |
Sorry I seen the commit message which looked like logging, the PR makes it clear that this was the intention #1908 The files handler I tested by setting the file to read only on the box. This is about failing to get a write lock, I agree that an error should be returned but would also argue that the error should be when you try and write to the session. Eg
No error - no writes are needed
|
This breaking change was fun to track down, and doesn't appear to be mentioned in the Changelog. I would agree that there should be an Unfortunately as v6 has already been released for some time, it would be a BC break for v6.0.3 to switch back to v5's behaviour, so its too late for a simple revert like #2386 but that would be the desired behaviour if the |
We are seeing issues of sessions disappearing and then coming back which started happening when moving to redis 6 from 5.3.7
This happens when the session lock is triggered
Expected behaviour
Session lock waits and then acquires a lock
Actual behaviour
Lock not acquired and the page load looks as if the session doesnt exist.
I'm seeing this behaviour on
Steps to reproduce, backtrace or example script
Adding to php.ini
session.save_handler = redis
session.save_path = "redis-node:6379"
redis.session.locking_enabled=1
redis.session.lock_retries=10
I've checked
develop
branchNot fully sure what the issue is, but looks like nothing in dev
Looking at the diff between 5.3.7 and 6, the backoff strategies were added so im guessing its related to that, but I can't see the docs on adding to the php.ini for the session.
Happy to trial a solution.
The text was updated successfully, but these errors were encountered: