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

Fix deadlock on DeferredConfirmations #47

Merged
merged 7 commits into from
Mar 17, 2022

Conversation

SpencerTorres
Copy link
Contributor

This PR improves the changes proposed in #44 originally made by @shifengbin

Changes:

  • Fixed deadlock that occurs with DeferredConfirmations when connection is reset
  • Made the fix's code more consistent with the other methods in the file
  • Added some documentation for Wait() and other internal methods
  • Added unit test for deferredConfirmations.Close()
  • Added integration test to confirm that .Wait() will return ack: false when connection is closed (as suggested by @DanielePalaia )

The newly added unit & integration tests both passed consistently when I ran them

This problem is also mentioned in #46

@DanielePalaia DanielePalaia self-assigned this Mar 17, 2022
Copy link
Contributor

@DanielePalaia DanielePalaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi thanks for your PR,

it looks good to me but in the integration test the PublishWithDeferredConfirm should publish to a non existent exchange in order to let Wait to return a false ack.

Can you replace line 1829 of integration_test.go to publish to a non existent exchange?

@SpencerTorres
Copy link
Contributor Author

It passed for both scenarios interestingly enough. Updated it anyway to publish to an exchange that does not exist

Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Contributor

@DanielePalaia DanielePalaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Approved!

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.

4 participants