With publisher confirms and automatic recovery enabled, when a network failure occurs, acks / nacks no longer get pushed onto the confirms continuations queue. This causes future wait_for_confirms to fail, even though the messages published since network recovery have been acknowledged by the broker.
I have included a spec with this PR that catches the problem and a fix that resets unconfirmed_set on network recovery. I tried to keep the stress spec as concise as possible but it does take around 20-30 seconds to run.
Any suggestions to improve this are welcome. In particular I wasn't sure whether to put my spec into spec/issues instead.
Stress spec: ensure all messages consumed
wait_for_confirms for each batch of messages and ensure they have all been
Ensure all ids get received by subscriber at least once
Reset unconfirmed_set on network recovery
Unconfirmed messages will never be confirmed by broker after network
connection loss. Reset unconfirmed_set on recovery
Makes sense. Thank you.
Thanks @michaelklishin for the quick merge.