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
Fatal when transaction broken in Sentinel #459
Comments
Okay so for anyone in the future that sees this what happened to me when I got To fix it I had to execute the multi transaction then run the get then start another multi transaction. Seems like a flaw in Predis but its easy enough to work around. Not super efficient, but easy to work around. |
The problem actually is that you are using persistent connections (see On the server-side Redis keeps tabs of the current state of each What happens when using persistent connections in your script is that when the script exits (either intentionally or because of a fatal error) leaving a pending If PHP exposed a way to assign some kind of custom state to persistent resources in userland code then there could be a way to handle this directly inside of Predis but unfortunately this is not the case. |
Problem
In persistent mode when transaction was aborted I get fatal error
\Predis\Connection\Aggregate\SentinelReplication::assertConnectionRole:526
Cannot use object of type Predis\Response\Status as array in ../src/Connection/Aggregate/SentinelReplication.php on line 526
How to reproduce
Create script, which doesn't close transaction
Then i am starting the server:
And when we request our script, predis will produce fatal error.
How to solve
We need to check
$actualRole
var for object or array.The text was updated successfully, but these errors were encountered: