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

Multiple reject/ack call should throw precondition failed #156

Open
shark300 opened this issue Sep 9, 2020 · 1 comment
Open

Multiple reject/ack call should throw precondition failed #156

shark300 opened this issue Sep 9, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@shark300
Copy link

shark300 commented Sep 9, 2020

I tried to deploy our application to staging environment and I assumed it will work without exception/warning because I have tested some error cases in ITs regarding to message rejecting too. Unfortunately, I have got some warning:

"Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 1, class-id=60, method-id=80)"

The root cause of this warning is that:

"Client Errors: Double Acking and Unknown Tags
Should a client acknowledge the same delivery tag more than once, RabbitMQ will result a channel error such as PRECONDITION_FAILED - unknown delivery tag 100. The same channel exception will be thrown if an unknown delivery tag is used." https://www.rabbitmq.com/confirms.html

I've tried some combination of rejecting but I can't get a warning in this use cases:

      channel.basicReject(original.getMessageProperties().getDeliveryTag(), false); // successful
      channel.basicReject(original.getMessageProperties().getDeliveryTag(), false); // already rejected, should have a warning
      channel.basicReject(original.getMessageProperties().getDeliveryTag(), false); // successful
      channel.basicAck(original.getEnvelope().getDeliveryTag(), false); // already rejected, should have a warning
      channel.basicAck(original.getEnvelope().getDeliveryTag(), false); // successful
      channel.basicReject(original.getMessageProperties().getDeliveryTag(), false); // already acknowledged, should have a warning
      channel.basicAck(original.getEnvelope().getDeliveryTag(), false); // successful
      channel.basicAck(original.getEnvelope().getDeliveryTag(), false); // already acknowledged, should have a warning
      channel.basicReject(15, false); // unknown tag, should have a warning too
      channel.basicAck(15, false); // unknown tag, should have a warning too
@ledoyen
Copy link
Contributor

ledoyen commented Sep 11, 2020

Hi, thanks for reporting this.

A fix will be supplied as soon as I get the time to do it.

It is the perfect opportunity to setup a new kind of test were the test is played twice with a real rabbitmq and with the mock to assert that the behavior is consistent.

@ledoyen ledoyen added the bug Something isn't working label Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants