Skip to content

Commit

Permalink
Ensure the narayana-jta extension fully shuts down the recovery manager
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusgrov committed Aug 2, 2023
1 parent 9aa28e3 commit 2f1d2b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
import com.arjuna.ats.arjuna.coordinator.TxControl;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
import com.arjuna.ats.internal.arjuna.objectstore.jdbc.JDBCStore;
import com.arjuna.ats.jta.common.JTAEnvironmentBean;
import com.arjuna.ats.jta.common.jtaPropertyManager;
Expand Down Expand Up @@ -158,7 +157,12 @@ public void startRecoveryService(final TransactionManagerConfiguration transacti
public void handleShutdown(ShutdownContext context, TransactionManagerConfiguration transactions) {
context.addLastShutdownTask(() -> {
if (transactions.enableRecovery) {
RecoveryManager.manager().terminate(true);
try {
QuarkusRecoveryService.getInstance().stop();
} catch (Exception e) {
throw new RuntimeException(e);
}
QuarkusRecoveryService.getInstance().destroy();
}
TransactionReaper.terminate(false);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ public void create() {
}
xaResources.clear();
}

@Override
public void destroy() {
super.destroy();
isCreated = false;
recoveryManagerService = null;
}
}

0 comments on commit 2f1d2b0

Please sign in to comment.