From 70d71b5576ca16bd3b6232cb01aae5e3b324ee91 Mon Sep 17 00:00:00 2001 From: Stefan CORDES <50696194+ca-stefan-cordes@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:12:23 +0100 Subject: [PATCH 1/2] Rollback all inflight transactions when shutting down to inform all resource holders (specially XA ones) nothing more will happen here. This avoids indoubt threads like V466-THREAD HAS BEEN INDOUBT FOR 27:25:58 V451-RESYNC WITH COORDINATOR STILL PENDING --- .../tm/BitronixTransactionManager.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java b/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java index 24114e4d..dec654de 100644 --- a/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java +++ b/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java @@ -370,13 +370,38 @@ private void internalShutdown() { if (txCount > 0) { if (log.isDebugEnabled()) log.debug("still " + txCount + " in-flight transactions, shutting down anyway"); dumpTransactionContexts(); + rollbackAllInFlightTransactions(); } else { if (log.isDebugEnabled()) log.debug("all transactions finished, resuming shutdown"); } } - public String toString() { + /** + * Rollback all inflight transactions when shutting down to inform all resource holders (specially XA ones) + * nothing more will happen here. + * This avoids indoubt threads like + *
+ * V466-THREAD HAS BEEN INDOUBT FOR 27:25:58 + * V451-RESYNC WITH COORDINATOR STILL PENDING + *+ */ + private void rollbackAllInFlightTransactions() { + log.warn("Rollback all remaining "+inFlightTransactions.size()+" inFlightTransactions"); + for (Map.Entry