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

Enforce correct transfer settled flag (backport #12371) #12379

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Sep 25, 2024

For messages published to RabbitMQ, RabbitMQ honors the transfer settled field, no matter what value the sender settle mode was set to in the attach frame.

Therefore, prior to this commit, a client could send a transfer with settled=true even though sender settle mode was set to unsettled in the attach frame.

This commit enforces that the publisher sets only transfer settled fields that are valid with the spec.

If sender settle mode is:

  • unsettled, the transfer settled flag must be false.
  • settled, the transfer settled flag must be true.
  • mixed, the transfer settled flag can be true or false.

This PR also fixes a bug in the AMQP 1.0 shovel:
The shovel violated the AMQP 1.0 spec by sending transfers with settled=true under sender settle mode unsettled if shovel ack-mode is set to on-publish.

This PR will break shovels if:

  1. shovel runs on RabbitMQ < 4.0.3, and
  2. connects via AMQP 1.0 to a RabbitMQ node >= 4.0.3, and
  3. uses shovel ack-mode value on-publish

Given all three combinations combined are extremely rare, on-publish alone is already a rare setting (on-confirm which is the default, or no-ack make much more sense than on-publish), I think it's fine to backport this PR to v4.0.x. In case someone hits this combination, the user can change the ack-mode.


This is an automatic backport of pull request #12371 done by [Mergify](https://mergify.com).

For messages published to RabbitMQ, RabbitMQ honors the transfer `settled`
field, no matter what value the sender settle mode was set to in the attach
frame.

Therefore, prior to this commit, a client could send a transfer with
`settled=true` even though sender settle mode was set to `unsettled` in the
attach frame.

This commit enforces that the publisher sets only transfer `settled` fields
that are valid with the spec.

If sender settle mode is:
* `unsettled`, the transfer `settled` flag must be `false`.
* `settled`, the transfer `settled` flag must be `true`.
* `mixed`, the transfer `settled` flag can be `true` or `false`.

(cherry picked from commit 9d7ebf3)
The shovel violated the AMQP 1.0 spec by sending transfers with settled=true
under sender settle mode unsettled (in case of shovel ack-mode being
on-publish).

(cherry picked from commit c0fbc1a)
@mergify mergify bot assigned ansd Sep 25, 2024
@ansd ansd merged commit 127a5ee into v4.0.x Sep 25, 2024
38 of 39 checks passed
@ansd ansd deleted the mergify/bp/v4.0.x/pr-12371 branch September 25, 2024 16:11
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.

1 participant