-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Publish with confirmation may raise error even when message was successfully published #80
Comments
I believe this should solve this @enkelli. Can you +1 up it if it looks good to you? Based on testing it looks like the error check is only needed when the mandatory flag is set. I changed the code to only check for errors when that flag is set. I also changed it so that it only looks for publishing errors. |
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
May 31, 2020
eandersson
added a commit
that referenced
this issue
Jun 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hi, I think I've found one problem in delivery confirmation - in _publish_confirm method. There are three following important (and probably buggy) lines:
The first line sends data to RMQ, second one tries to get status of this action and the third line checks for errors. Where is the bug? That many things may happen between the
write_frames
and delivery checks. I've checked briefly implementation of those two methods (rpc.get_request
andcheck_for_errors
) and it seems that there is some other network communication that may fail. Which results to delivery-failed response while the messages was actually published.This may be really unpleasant for a system that e.g. retries in case of a failed publish and duplicate messages are undesirable.
How you can verify this:
I've verified my theory using docker RMQ, but you can of course use custom RMQ server and somehow interrupt internet connection, see below.
rabbitmq:3-management
, expose ports 5672 and 15672 and run tests to ensure that it works. I did run only some tests:amqpstorm/tests/functional/generic_tests.py
, using nose)_publish_confirm
method and puttime.sleep(30)
(30, more or less, so you have enough time to disable connection) afterwrite_frames
, before delivery checks.nosetests amqpstorm/tests/functional/generic_tests.py -m test_functional_publish_and_get_a_large_message
. I also wrappedpublish
call in this test totry-except
block so I could print the thrown error inexcept
block. it wasAMQPConnectionError("Connection was closed by remote server: CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'"
sleep
, put to thatpublish
method, expires.sleep
finishes, it should print the error message.I hope the description is clear. Otherwise, let me know, I'll try to answer your questions.
Definition of done
Error is raised only when a message was not delivered to the RMQ server.
The text was updated successfully, but these errors were encountered: