Skip to content

Commit

Permalink
0003476: When a node is unregistered cancel all jobs / threads that are
Browse files Browse the repository at this point in the history
actively doing work for that node
  • Loading branch information
JishLong committed Jun 5, 2023
1 parent 6f35c97 commit fdc6c88
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -51,6 +51,7 @@
import org.jumpmind.symmetric.model.NodeHost;
import org.jumpmind.symmetric.model.NodeSecurity;
import org.jumpmind.symmetric.model.NodeStatus;
import org.jumpmind.symmetric.model.ProcessInfo;
import org.jumpmind.symmetric.security.INodePasswordFilter;
import org.jumpmind.symmetric.service.FilterCriterion;
import org.jumpmind.symmetric.service.FilterCriterion.FilterOption;
Expand Down Expand Up @@ -208,6 +209,13 @@ public void updateNodeHostForCurrentNode() {
}

public void deleteNode(String nodeId, boolean syncChange) {
log.info("Unregistering node {} and removing it from database", nodeId);
for (ProcessInfo info : engine.getStatisticManager().getProcessInfos()) {
if (info.getTargetNodeId() != null && info.getTargetNodeId().equals(nodeId)) {
log.info("Sending interrupt to " + info.getKey() + ",batchId=" + info.getCurrentBatchId());
info.getThread().interrupt();
}
}
ISqlTransaction transaction = null;
try {
transaction = sqlTemplate.startSqlTransaction();
Expand Down

0 comments on commit fdc6c88

Please sign in to comment.