-
Bug
-
Resolution: Done
-
Major
-
5.9.8.Final
-
None
If the recovery is triggered with tx listener by socket call like SCAN and the recovery process itself finishes with an unexpected exception (e.g. IllegalStateException) then the listener is not informed about this happens to close and report back to user. This ends up with hanging connection and the stuck doRecovery call.
The stack trace of the ISE is like this
ERROR [stderr] (Periodic Recovery) Exception in thread "Periodic Recovery" java.lang.IllegalArgumentException
at com.arjuna.ats.internal.jta.transaction.arjunacore.jca.TransactionImporterImple.recoverTransaction(TransactionImporterImple.java:127)
at com.arjuna.ats.internal.jta.transaction.arjunacore.jca.TransactionImporterImple.recoverTransaction(TransactionImporterImple.java:52)
at com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule.periodicWorkFirstPass(SubordinateAtomicActionRecoveryModule.java:74)
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770)
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:382)
Stuck connection is like this
"Server.Connection:127.0.0.1:42768" #193 daemon prio=5 os_prio=0 tid=0x00007f9c20002000 nid=0x11ed8 in Object.wait() [0x00007f9dd08f8000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000000d6f5ec08> (a com.arjuna.ats.internal.arjuna.recovery.WorkerService) at java.lang.Object.wait(Object.java:502) at com.arjuna.ats.internal.arjuna.recovery.WorkerService.doWork(WorkerService.java:101) - locked <0x00000000d6f5ec08> (a com.arjuna.ats.internal.arjuna.recovery.WorkerService) at com.arjuna.ats.internal.arjuna.recovery.Connection.run(Connection.java:88)
Tx listener waits forever as the connection is never flushed (https://github.com/jbosstm/narayana/blob/5.9.8.Final/txbridge/src/test/java/org/jboss/jbossts/txbridge/tests/inbound/junit/InboundCrashRecoveryTests.java#L193)