PR #617 introduced an optimization for multi-message acks but failed to protect @unconfirmed_set. In edge cases #basic_publish would attempt to modify it during iteration with Enumerable#min:
<ruby>/lib/ruby/3.1.0/set.rb:522:in `add': can't add a new key into hash during iteration (RuntimeError)
from <bunny>/lib/bunny/channel.rb:555:in `block in basic_publish'
from <bunny>/lib/bunny/channel.rb:554:in `synchronize'
from <bunny>/lib/bunny/channel.rb:554:in `basic_publish'
from <bunny>/lib/bunny/exchange.rb:141:in `publish'
PR #617 introduced an optimization for multi-message acks but failed to protect @unconfirmed_set. In edge cases #basic_publish would attempt to modify it during iteration with Enumerable#min: