Repository navigation
ARTEMIS-6362 A send refused after its duplicate id check leaves the duplicate id cache as it was - #6883
Open
grepjava wants to merge 1 commit into
Open
ARTEMIS-6362 A send refused after its duplicate id check leaves the duplicate id cache as it was#6883grepjava wants to merge 1 commit into
grepjava wants to merge 1 commit into
Conversation
…uplicate id cache as it was
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For a send outside a transaction,
PostOfficeImpl.checkNotBridgeDuplicateIDstarts a transaction and callsaddToCache(duplID, tx, true), which put the id in the cache at once, overwriting the oldest slot of a full cache, and registered anAddDuplicateIDOperationthat deleted the new id on rollback. When routing then failed (an address full underFAIL, say), the rollback took the new id out, but the id it had overwritten was gone: sending that older message again was delivered.Both caches now keep such an id aside, in a count of ids in flight that
containsalso checks, so a concurrent send of it is still a duplicate. It takes its slot inbeforeCommit, once the send was routed, and a rollback just releases it, so a send that fails leaves the cache as it was. The bridge'satomicVerifygoes the same way.DuplicateDetectionTest.testRefusedSendKeepsTheIdBeforeItuses an address withid-cache-size1 andFAIL: "d1" is accepted, the address is filled, "d2" is refused, and once the queue is drained "d1" sent again must be dropped as a duplicate. It fails without the fix.https://issues.apache.org/jira/browse/ARTEMIS-6362