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

Publisher confirm tests fail sporadically #157

Closed
michaelklishin opened this issue Mar 12, 2019 · 9 comments
Closed

Publisher confirm tests fail sporadically #157

michaelklishin opened this issue Mar 12, 2019 · 9 comments

Comments

@michaelklishin
Copy link
Member

michaelklishin commented Mar 12, 2019

Publisher confirms test sporadically fails for no known reason. This seemingly only happens when a lot of tests are executed at the same time.

Anecdotal evidence leads me to believe it could a dispatch queue interference. That's just a totally unconfirmed hypothesis at the moment. Possibly related to #56.

I am yet to capture traffic when this happens. Now that we have user-provided connection name support (#156), it should be easier to identify this test's connection in both Wireshark and server logs.

@SimonErm
Copy link

SimonErm commented Aug 7, 2019

I found some more weird behaviour with afterConfirm. This time i send 6 messages (all delivered succesful), but receive 1 ack(first call of afterConfirm handler), 1 with neither ack nor nack(next call) and then 4 nacks. Furthermore channel.basicPublish always returned 1. Shouldn't it at least increment?
This problem doesn't make any sense to me.

@michaelklishin
Copy link
Member Author

Channel#basicPublish shouldn't have any return value. There is no response for basic.publish and related payload frames in the protocol.

@SimonErm
Copy link

SimonErm commented Aug 7, 2019

I found it here:

* @return A sequence number that correlates to the numbers sent to the afterConfirmation block (when publisher confirmations are enabled).

@michaelklishin
Copy link
Member Author

michaelklishin commented Aug 7, 2019

It was a mistake. No other client returns anything like this from basicPublish. Let's. focus on the issue at hand.

@SimonErm
Copy link

SimonErm commented Aug 7, 2019

I did an example repo: https://github.com/SimonErm/rabbitmq-objc-client-after-confirm-reproduction .
Just checkout and run npm install and docker run -p 5672:5672 -e RABBITMQ_DEFAULT_VHOST=test rabbitmq:3
Then you can set a breakpoint in the ConfirmationCallback in AfterConfirmReproduce.swift and run the App from objcRabbitmqAfterConfirm workspace

@SimonErm
Copy link

I got it working for me by using DipatchSemaphore and registering afterConfirm after publish like it's done in

let semaphore = DispatchSemaphore(value: 0)

@michaelklishin
Copy link
Member Author

@SimonErm thanks for following-up. I should be able to pick up your repro example in the 2nd half of next week. So it's not been forgotten.

@michaelklishin
Copy link
Member Author

Curiously I no longer can reproduce.

@michaelklishin
Copy link
Member Author

This example does not await confirmations, so the method is as safe as if confirms were not used at all.

I had a different problem but with XCode 11 it seems to be gone. Oh well :)

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

No branches or pull requests

2 participants