-
Notifications
You must be signed in to change notification settings - Fork 438
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
Spanner: Deleted sessions are not removed from the session pool #5827
Comments
Hi @taka-oyama, thanks for raising this issue. Does this workaround sound good to you? |
We already tried using I don't think
In our case, we have a dequeue worker running for long extended periods and this was causing our workers to go into a unrecoverable state in which the only way to recover from it was to restart the server. |
Does something like this work for your usecase? |
Thanks for implementing a fix. It should, but this is really difficult to test... The only way we can is to wait 28 days...? |
@taka-oyama waiting for 28d is not practical. |
OK. Thanks. I think this will work for us. |
Currently, the all sessions stay in the session pool and is not deleted until it expires.
This causes problems when the server side deletes the sessions..
The code keeps reusing the non-existent session and will keep throwing the exception below.
I think "Session not found exception"s should trigger code that will delete the stale session from the session pool.
I have prepared a sample code to replicate the issue.
Environment details
Steps to reproduce
git clone [email protected]:taka-oyama/google-cloud-php-test.git
git checkout test/spanner-session-not-found
.env.sample
to.env
and configure it to match your setup.docker-compose build && docker-compose run app
-> this will start a bash session inside the container.php session_use.php
to create a session a run a single query.php session_delete.php
to delete the session on the server (but not from the session pool)php session_use.php
again.The text was updated successfully, but these errors were encountered: