Skip to content

Fix message acks on wrong rabbitmq channels#4358

Merged
pcapriotti merged 15 commits intodevelopfrom
rabbitmq-acks
Dec 11, 2024
Merged

Fix message acks on wrong rabbitmq channels#4358
pcapriotti merged 15 commits intodevelopfrom
rabbitmq-acks

Conversation

@pcapriotti
Copy link
Contributor

@pcapriotti pcapriotti commented Dec 3, 2024

This PR fixes an issue with the way client acks are delivered to rabbitmq. When a channel dies and is replaced by a new one, it can happen that acks that were in flight are delivered to the wrong channel. This is bad, because it can cause the wrong message to be acked, or the channel to be forcibly closed by the rabbitmq server.

The fix is to simply control whether channel reconnection is enabled based on a new enableRetry flag in the connection pool. For cannon pools, this flag is always set to False, thereby disabling reconnection completely, and letting the client handle any rabbitmq disconnection by creating a new websocket connection.

Setting the flag to True can be useful if/when the rabbitmq connection pool is used in background worker or other services.

https://wearezeta.atlassian.net/browse/WPB-11491

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@echoes-hq echoes-hq bot added the echoes/initiative: scale Enterprise Readiness Initiatives label Dec 3, 2024
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 3, 2024
@pcapriotti pcapriotti marked this pull request as ready for review December 3, 2024 14:28
Co-authored-by: Akshay Mankar <akshay@wire.com>
@pcapriotti pcapriotti merged commit 8af8925 into develop Dec 11, 2024
@pcapriotti pcapriotti deleted the rabbitmq-acks branch December 11, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

echoes/initiative: scale Enterprise Readiness Initiatives ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants