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
calling check_heartbeat causes connection to close #617
Comments
I will restore the line that updates |
Thanks, appreciate your help and quick response. |
@rbro please test |
Thanks, I confirm it's good now. Is calling |
The correct way is to wait on a channel and do your work quickly or in a separate process. Otherwise, this method is the only (hacky) option at this point. C'est la vie! |
Thanks, in my case, I'm offloading the work to php-fpm using https://github.com/hollodotme/fast-cgi-client, so I'm calling
|
I am running into an issue with 2.8.0 or later with long running processes and calling check_heartbeat to keep the connection active. The problem existed in 2.7.2 and earlier, but I had a workaround that no longer seems to work in 2.8.0. I mentioned it originally in #507 (comment).
The connection is being closed even if check_heartheart() is called because $this->last_read stays the same. This caused reconnect() to be called in 2.7.2, and in 2.8.0, the exception "Missed server heartbeat" is thrown.
The workaround I found in 2.7.2 was to call read(0) instead of check_heartbeat(). That got around it since $this->last_read is updated after each call. That line seems to have been removed from the end of the read() function in 2.8.0:
If you run the below script, you will get the exception "Missed server heartbeat" after about 5 seconds even though you are calling check_heartbeat(). If you call read(0), you will get the same exception. If you try calling read(0) against 2.7.2 code, you won't get an exception because the read(0) call will keep the connection active since last_read will get updated, and therefore, the old "reconnect" function won't get called.
Is there something that can be changed so that either:
Thanks for your help.
The text was updated successfully, but these errors were encountered: