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

Added error handling for IO error #104

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Conversation

markus812498
Copy link
Collaborator

@markus812498 markus812498 commented Feb 17, 2023

Adding error message and close connection for clients when the connection between RabbitMQ and AMQProxy is closed.

To reproduce.

  • Use client that reconnects automatically:
  • Set up AMQProxy to a RabbitMQ cluster.
  • Simulate network issue between AMQProxy/RabbitMQ (e.g. block traffic using nftables and force close connection in RMQ).
  • Client will reconnect to AMQProxy, but AMQProxy won't be able to connect to RabbitMQ. AMQProxy will throw an IO Error.

This PR will ensure error is logged, and client is disconnected (as connection is broken to the cluster).

@johanrhodin
Copy link
Member

@carlhoerberg can you take a look at this

@carlhoerberg carlhoerberg merged commit ed37567 into cloudamqp:main Mar 28, 2023
@cdudevops
Copy link

When to expect a release with this code update ? I have similar problem, amqproxy remains blocked when rabbitmq cluster connection timeouts.

@dentarg
Copy link
Member

dentarg commented May 10, 2023

@cdudevops It has been released now, with v0.8.8

dentarg added a commit that referenced this pull request Oct 3, 2023
This change also removes the code added in #104

The motivation behind that is

* IO:_Error that happens in Upstream#connect is raised as Upstream::Error
* IO::Error that happens in Upstream#read_loop is rescued in that method
* IO::Error that happens in Client#read_loop is raised as Client::Error

Adds an integration test with the php-amqp client run via Docker Compose
and Toxiproxy.

Close #118
Close #111
Close #98
dentarg added a commit that referenced this pull request Oct 11, 2023
This change also removes the code added in #104

The motivation behind that is

* IO:_Error that happens in Upstream#connect is raised as Upstream::Error
* IO::Error that happens in Upstream#read_loop is rescued in that method
* IO::Error that happens in Client#read_loop is raised as Client::Error

Adds an integration test with the php-amqp client run via Docker Compose
and Toxiproxy.

Close #118
Close #111
Close #98
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.

5 participants