Skip to content

Conversation

@jbertram
Copy link
Contributor

@jbertram jbertram commented Jan 7, 2026

Currently the broker will rollback the current transaction associated with a session when it is unable to find the XID passed when rolling back. This is a pseudo optimization for the case where the current transaction has timed out and the client may be holding on to messages.

However, this is a mistake because the current transaction may still be valid. One such use-case involves XA transaction recovery in a Java EE server where a dedicated recovery process may attempt to rollback a transaction that no longer exists (e.g. due to timeout, broker restart, etc.) while a valid transaction is still active and associated with the Session.

Currently the broker will rollback the current transaction associated
with a session when it is unable to find the XID passed when rolling
back. This is a pseudo optimization for the case where the current
transaction has timed out and the client may be holding on to messages.

However, this is a mistake because the current transaction may still be
valid. One such use-case involves XA transaction recovery in a Java EE
server where a dedicated recovery process may attempt to rollback a
transaction that no longer exists (e.g. due to timeout, broker restart,
etc.) while a valid transaction is still active and associated with the
Session.
@jbertram
Copy link
Contributor Author

jbertram commented Jan 7, 2026

The full test-suite is green on this change.

@tabish121
Copy link
Contributor

LGTM

@tabish121 tabish121 merged commit 39de83e into apache:main Jan 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants