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

Catch a couple exceptions in select #659

Merged
merged 2 commits into from Mar 15, 2019
Merged

Catch a couple exceptions in select #659

merged 2 commits into from Mar 15, 2019

Conversation

lukebakken
Copy link
Collaborator

Fixes #627

@programmer512 please review and test if you have time, thanks.

@ramunasd - if you have a second to read #627 and review, I would appreciate it.

@lukebakken lukebakken added this to the 2.9.0 milestone Mar 13, 2019
@lukebakken lukebakken self-assigned this Mar 13, 2019
@ramunasd
Copy link
Member

Hi @lukebakken , thanks for fix. I thought this is fixed after #653. But looks like AbstractConnection->select() is yet another place where things can go wrong.
I suggest to extend AMQPHeartbeatMissedException from AMQPConnectionClosedException ( missed heartbeat is subset of all closed connection issues) and catch AMQPConnectionClosedException here:

} catch (AMQPHeartbeatMissedException $e) {

Then we will keep consistent exception handling in all places. Agree?

@lukebakken
Copy link
Collaborator Author

@ramunasd thank you for the suggestion. This is the last item for 2.9.0 🎉 ... if you have a second for a final review, that would be great. Thanks!

@ramunasd
Copy link
Member

LGTM, tested it additionaly using testsuites from php-enqueue.

@lukebakken
Copy link
Collaborator Author

Thanks!

@lukebakken lukebakken merged commit f830012 into master Mar 15, 2019
@lukebakken lukebakken deleted the php-amqplib-627 branch March 15, 2019 21:35
@programmer512
Copy link

programmer512 commented Mar 18, 2019

@lukebakken thank you for fix.
But my problem was inside check_heartbeat() function which is called from StreamIO::read() method, not from AbstractConnection::select(), and this exception "AMQPHeartbeatMissedException" is thrown from there

public function read($len)
{
$this->check_heartbeat();

@lukebakken
Copy link
Collaborator Author

This should be caught in AbstractConnection now that AMQPHeartbeatMissedException derives from AMQPConnectionClosedException. There are only three places where read is called on an AMQPReader instance and AMQPConnectionClosedException is handled.

@ramunasd @programmer512 if this could be verified that would be great.

@programmer512
Copy link

@lukebakken, thank you.
I will prepare a test and verify it.

@programmer512
Copy link

@ramunasd , @lukebakken thank you very much
You are completely right. I did not notice that inside AbstractConnection::wait_frame there is a catch for AMQPConnectionClosedException. So no problem then. Everything is clear and correct from my side.
Sorry for disturbing you because of misunderstanding

@lukebakken
Copy link
Collaborator Author

I appreciate that you verified this @programmer512 !!!!

kratkyzobak pushed a commit to kratkyzobak/php-amqplib that referenced this pull request Feb 9, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants