jakubkulhan / bunny

Performant pure-PHP AMQP (RabbitMQ) sync/async (ReactPHP) library
MIT License
698 stars 101 forks source link

Fix drop connection by RabbitMQ #120

Closed viras777 closed 3 months ago

viras777 commented 2 years ago

Fix if RabbitMQ closed the connection due to incorrect login/password. Similar problems in here issues: Change state to error when ClientException is throw #115 or Failing connections cause exceptions thrown outside of Promise #74 or ClientException #59

WyriHaximus commented 2 years ago

Thank you for filing this PR, could you rebase on the latest changes in master now that #106, and do you think it is possible to test this?

viras777 commented 2 years ago

I tested on my test server and now works on the production server

WyriHaximus commented 2 years ago

@viras777 Thanks for the update. Any clue what it fails for certain jobs?

viras777 commented 2 years ago

In the function awaitConnectionTune I added interception of all exceptions to be able to process in reject. like this: Connection = (new Client())->connect()->then()->otherwise();

Because of this, the tests do not pass, they expect another type of exception

viras777 commented 1 year ago

Sometimes there are missed hearbeats with an error on the rabbitmq server: "missing heartbeats from client, timeout: 60s" and bunny take 100 CPU for a while. This happens when $nextStreamSelectTimeout < $ now < $ stopTime For example call method run(1) and wait 60s

WyriHaximus commented 3 months ago

Odd, CI blow up, but not on lowest possible dependencies. Will fix before releasing