Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
import java.util.Map;
import java.util.Set;

import org.knime.core.checkpoint.PhasedInit;
import org.knime.core.checkpoint.PhasedInitSupport;
import org.knime.core.node.NodeLogger;
import org.knime.python3.PythonGatewayCreationGate.PythonGatewayCreationGateListener;

Expand All @@ -79,6 +81,17 @@ public final class PythonGatewayTracker implements PythonGatewayCreationGateList

private PythonGatewayTracker() {
m_openGateways = gatewaySet();
// Support CRaC (Coordinated Restore at Checkpoint) and close all connections prior checkpointing
PhasedInitSupport.registerOrActivate(new PhasedInit<RuntimeException>() {
@Override
public void beforeCheckpoint() throws RuntimeException {
try {
clear();
} catch (IOException ex) {
LOGGER.warn("Error when forcefully terminating Python processes during phased initialization", ex);
}
Comment on lines +84 to +92
}
});
Comment on lines +85 to +94
}

/**
Expand Down
Loading