use of com.tencent.angel.protobuf.generated.WorkerMasterServiceProtos.WorkerErrorResponse in project angel by Tencent.
the class MasterService method workerError.
/**
* worker run failed
*
* @param controller rpc controller of protobuf
* @param request contains worker attempt id, error message
*/
@SuppressWarnings("unchecked")
@Override
public WorkerErrorResponse workerError(RpcController controller, WorkerErrorRequest request) throws ServiceException {
WorkerAttemptId workerAttemptId = ProtobufUtil.convertToId(request.getWorkerAttemptId());
LOG.info("worker attempt " + workerAttemptId + " failed, details=" + request.getMsg());
WorkerErrorResponse.Builder resBuilder = WorkerErrorResponse.newBuilder();
// if worker attempt id is not in monitor set, we should shutdown it
if (!context.getWorkerManager().isAlive(workerAttemptId)) {
resBuilder.setCommand(WorkerCommandProto.W_SHUTDOWN);
} else {
context.getWorkerManager().unRegister(workerAttemptId);
context.getEventHandler().handle(new WorkerAttemptDiagnosticsUpdateEvent(workerAttemptId, request.getMsg()));
context.getEventHandler().handle(new WorkerAttemptEvent(WorkerAttemptEventType.ERROR, workerAttemptId));
resBuilder.setCommand(WorkerCommandProto.W_SUCCESS);
}
return resBuilder.build();
}
Aggregations