Bugfix: DLX parameters aren't updated when the messages is expired #601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHAT is this pull request doing?
The effect of this bug is that
count
on a DLX message is counted up to 2 but never higher. It's set to 1 when the headers are created, we get the first count and increase that, but instead of updating in place the new count is added as a new field in the table.AMP::Table doesn't support
Symbol
for it's#delete
method, which results in when using#merge!
the new pairs are added onto the backing IO for each call.The result is that after three expires the table looks like this:
If instead each key is set it overrides the previous value as expected.
HOW can this pull request be tested?
Not sure how to write specs for this
It can be tested manually by publish a message to a queue that is setup to when the message is rejected, it ends up in a DLX queue. Setup a TTL on the DLX queue so that when the TTL expires the messages is published back to the original queue, when that happens, look at the messages headers
x-death