Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset channel unconfirmed_set on network recovery #406

Merged

Conversation

biinari
Copy link
Contributor

@biinari biinari commented May 19, 2016

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.

biinari added 2 commits May 19, 2016 23:52
wait_for_confirms for each batch of messages and ensure they have all been
confirmed.

Ensure all ids get received by subscriber at least once
Unconfirmed messages will never be confirmed by broker after network
connection loss. Reset unconfirmed_set on recovery
@michaelklishin michaelklishin self-assigned this May 20, 2016
@michaelklishin michaelklishin merged commit e14cf84 into ruby-amqp:master May 20, 2016
@michaelklishin
Copy link
Member

Makes sense. Thank you.

@biinari
Copy link
Contributor Author

biinari commented May 20, 2016

Thanks @michaelklishin for the quick merge.

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