cloudamqp / amqp-client.rb

Modern AMQP 0-9-1 Ruby client
https://cloudamqp.github.io/amqp-client.rb/
MIT License
19 stars 6 forks source link

Confirm bug fix #25

Closed carlhoerberg closed 3 months ago

carlhoerberg commented 3 months ago

make sure Channel#wait_for_confirms actually waits for all confirms

Previsouly the unbounded unconfirmed_empty queue could be filled up with thousands of items, until num_waiting was zero. Now we make the queue sized, so it can't hold more than 1 item. We now have a race condition on num_waiting instead...

carlhoerberg commented 3 months ago

oh, the rake doc commit was meant to go into main branch directly, the second commit to its own PR.. will close and reopen.

dentarg commented 3 months ago

Something with these changes (not related to yard/redcarpet) makes the tests hang TruffleRuby (we timeout the step after 10 minutes) https://github.com/cloudamqp/amqp-client.rb/actions/runs/8412814944/job/23034143579

I have some pointers on how to run TruffleRuby locally in Docker at https://github.com/cloudamqp/amqp-client.rb/issues/16#issuecomment-2001951792

carlhoerberg commented 3 months ago

Now using ConditionVariable to avoid all race conditions. Also adding the unconfirmed delivery_tag to the @unconfirmed array before publishing to prevent race conditions there too.