Skip to content

Conversation

@shashankmehra
Copy link
Contributor

Custom workers which perform bunny related operations inside the work function through the handler can find themselves getting stuck when rabbitmq is restarted.

This can happen because the bunny exception raised by the work function is caught by the catch all rescue present in process_work function - and this does not let the exception bubble up leaving bunny in broken state and not receiving any more jobs.

This PR allows Bunny::Exception to be re-raised so that the worker does not get stuck.

My use case involves allowing the ActiveJob to configure whether ack would be sent before or after the job (so that the Job can decide on at lease once or at most once paradigm). The jobs which were sending ack early through the work function would raise this exception and the worker would get stuck.

@michaelklishin michaelklishin added this to the 3.3.0 milestone May 17, 2025
@michaelklishin
Copy link
Member

I cannot reproduce the Ruby 3.2.x failure locally.

@michaelklishin michaelklishin merged commit 58e6c33 into ruby-amqp:main May 17, 2025
6 of 8 checks passed
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.

2 participants