Skip to content

Enforce transaction semantics on RabbitMQ - #104

Merged
Anthchirp merged 4 commits into
mainfrom
pika-rewrite
Nov 12, 2021
Merged

Enforce transaction semantics on RabbitMQ#104
Anthchirp merged 4 commits into
mainfrom
pika-rewrite

Conversation

@Anthchirp

Copy link
Copy Markdown
Contributor

If a transaction is running on an outgoing channel then all messages
going out on that channel must either match this transaction, or - if
they are outside of a transaction - must be committed immediately.
If a transaction is running, has uncommitted messages, and then a
message is sent outside of a transaction an error must be raised, as
RabbitMQ does not support this behaviour.

The only messages outgoing on a transacting, subscribing channel are
ACK/NACK and transacted sends. (Untransacted sends do not go through
this channel, so do not need to be considered.) In all three cases,
set a flag if there are uncommitted messages on the transaction to
detect the above case, so that an error can be raised.

This adds a package dependency on bidict and closes#97

If a transaction is running on an outgoing channel then all messages
going out on that channel must either match this transaction, or - if
they are outside of a transaction - must be committed immediately.
If a transaction is running, has uncommitted messages, and then a
message is sent outside of a transaction an error must be raised, as
RabbitMQ does not support this behaviour.
The only messages outgoing on a transacting, subscribing channel are
ACK/NACK and transacted sends. (Untransacted sends do not go through
this channel, so do not need to be considered.) In all three cases,
set a flag if there are uncommitted messages on the transaction to
detect the above case, so that an error can be raised.
@codecov

codecovBot commented Nov 8, 2021

Copy link
Copy Markdown

Codecov Report

Merging #104 (6675f0e) into main (f9f34c5) will decrease coverage by 0.59%.
The diff coverage is 20.00%.

@@ Coverage Diff @@## main #104 +/- ##
==========================================
- Coverage 82.07% 81.47% -0.60% 
==========================================
Files 22 22 Lines 1980 1997 +17 Branches 343 346 +3 ==========================================
+ Hits 1625 1627 +2 - Misses 268 284 +16 + Partials 87 86 -1 

@Anthchirp
Anthchirp merged commit 2c2944c into mainNov 12, 2021
@Anthchirp
Anthchirp deleted the pika-rewrite branch November 12, 2021 12:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

PikaTransport: Enforce semantics on transacting channels

1 participant

@Anthchirp