-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMQ-7211 STOMP: Do not clear pending ACKs on COMMIT #359
AMQ-7211 STOMP: Do not clear pending ACKs on COMMIT #359
Conversation
@tabish121 / @gtully / @cshannon -- Can I get someone to give this a review please? |
I took a look at the PR and reviewed the STOMP code a bit. The fix isn't really complete and in review I've noticed a couple other oddities around transactions and the pending Acks tracking which also needs fixed. |
Thanks for looking, @tabish121.
Can you elaborate on what you mean by this? Do you mean that you'd like me to do more around the fix, and if so can you provide some guidance? Or do you mean that you are planning on doing some work on making the fix "complete"? For me, the biggest thing is that the unit test I wrote here covers our use case and I would like to see it included in the tests to ensure that we aren't subject to regressions in the future. Thanks again! |
Clearing the pending acks was intended to mitigate leaks in the ack ID tracking and by removing the clears the original issue is reintroduced. The clear isn't correct as noted here but the accounting of the ack Ids needs to be done such that we aren't leaking them after TX operations or client and client-individual acknowledgements. There is a more serious issue here in that the ack Ids are lost when a Transaction is aborted and so the client cannot again ACK a message or NACK it for that matter as the entries for some or all the TX enlisted messages are lost (depending on ACK mode). I am working on a fix that should mitigate all these issues and adding additional tests to cover this |
This issue along with loss of ack ids after TX abort is fixed in 063d24e |
Thank-you very much for the comprehensive fix & accompanying test cases, @tabish121! |
I have not merged to the 5.15.x branch as yet, I'd appreciate if you could test the change on a local build with your application and see if the fix holds up to that use case. |
Just sent 1000 messages through with transactions enabled and everything looks great! |
This PR first adds a test that proves the behavior is broken: c3729b0
When you run this test against master it will fail:
The test output shows that it only took 4 messages to trigger this condition:
Which is the exception I reported in https://issues.apache.org/jira/browse/AMQ-7211
The fix for this (be19dca) is simply to NOT clear pending ACKs on transaction COMMIT & ABORT.
Looking at the ticket referenced in the commit that added the
pedingAcks.clear()
lines (52d95ee / https://issues.apache.org/jira/browse/AMQ-5423) I believe that changing thethis.pedingAcks.get
tothis.pedingAcks.remove
is the real solution to the memory leak that prompted the change and that clearing the acks at the end of a transaction is not needed and incorrect behavior.CC @tabish121 -- since you commited 52d95ee and worked on AMQ-5423