Skip to content

Commit

Permalink
Change publisher confirms behaviour to reject messages if no queues c…
Browse files Browse the repository at this point in the history
…onfirmed.

Channel is counting unacked messages in a remove-only data structure `dtree`.
Each published message id is associated with a list of queues where it was routed to.
On confirm of queue failures queues were removed from the list
As soon as there are no queues in the list - the message can be confirmed.

This meant that if all queues fail with "not abnormal" reasons - the message may be
confirmed, but not enqueued.

This change removes dtree data structure, replacing it with specific unconfirmed_messages
data structure.
It tracks queue pids similarly to dtree, but also has an API to record confirms and failures
differently, keeping track of which queues received at least one confirm.

If all pids fails or confirm, but not all queues received confirmation - it means not all queues
enqueued the message and the message should be rejected

This is different from the current behaviour, but corresponds to the docs and common sense.

[#163952410]
  • Loading branch information
hairyhum committed May 10, 2019
1 parent 5c80bea commit b7f29c1
Show file tree
Hide file tree
Showing 4 changed files with 488 additions and 242 deletions.
205 changes: 0 additions & 205 deletions src/dtree.erl

This file was deleted.

Loading

0 comments on commit b7f29c1

Please sign in to comment.