use of org.apache.ignite.failure.FailureType.CRITICAL_ERROR in project ignite by apache.
the class DistributedProcess method sendSingleMessage.
/**
* Sends single node message to coordinator.
*
* @param p Process.
*/
private void sendSingleMessage(Process p) {
assert p.resFut.isDone();
SingleNodeMessage<R> singleMsg = new SingleNodeMessage<>(p.id, type, p.resFut.result(), (Exception) p.resFut.error());
UUID crdId = p.crdId;
if (F.eq(ctx.localNodeId(), crdId))
onSingleNodeMessageReceived(singleMsg, crdId);
else {
try {
ctx.io().sendToGridTopic(crdId, GridTopic.TOPIC_DISTRIBUTED_PROCESS, singleMsg, SYSTEM_POOL);
} catch (ClusterTopologyCheckedException e) {
// The coordinator has failed. The single message will be sent when a new coordinator initialized.
if (log.isDebugEnabled()) {
log.debug("Failed to send a single message to coordinator: [crdId=" + crdId + ", processId=" + p.id + ", error=" + e.getMessage() + ']');
}
} catch (IgniteCheckedException e) {
log.error("Unable to send message to coordinator.", e);
ctx.failure().process(new FailureContext(CRITICAL_ERROR, new Exception("Unable to send message to coordinator.", e)));
}
}
}
Aggregations