This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 269be13c5a ARTEMIS-4652 rollback of XAResource impl shouldn't return 
XA_RETRY
269be13c5a is described below

commit 269be13c5a291c3944d8c379413398a6913985e4
Author: Justin Bertram <[email protected]>
AuthorDate: Tue Feb 20 15:17:57 2024 -0600

    ARTEMIS-4652 rollback of XAResource impl shouldn't return XA_RETRY
    
    This fix was based on static analysis of the code and inspection of the
    XA specification. There is no test associated with it due to the
    difficult nature in reproducing the failure. This code has been
    essentially the same for a decade and only now have there been any
    reports of it actually sending back the wrong XA code.
---
 .../artemis/core/client/impl/ClientSessionImpl.java        | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
index d3d0635aa0..0e1b7a4c01 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
@@ -1901,18 +1901,10 @@ public final class ClientSessionImpl implements 
ClientSessionInternal, FailureLi
          workDone = false;
       } catch (XAException xae) {
          throw xae;
-      } catch (ActiveMQException e) {
-         if (e.getType() == ActiveMQExceptionType.UNBLOCKED || e.getType() == 
ActiveMQExceptionType.CONNECTION_TIMEDOUT || e.getType() == 
ActiveMQExceptionType.SHUTDOWN_ERROR) {
-            // Unblocked on failover
-            throw new XAException(XAException.XA_RETRY);
-         }
-
-         // This should never occur
-         XAException xaException = new XAException(XAException.XAER_RMFAIL);
-         xaException.initCause(e);
-         throw xaException;
       } catch (Throwable t) {
-         // This could occur if the TM interrupts the thread
+         if (logger.isTraceEnabled()) {
+            logger.trace("Rollback failed:: {}", convert(xid), t);
+         }
          XAException xaException = new XAException(XAException.XAER_RMFAIL);
          xaException.initCause(t);
          throw xaException;

Reply via email to