private synchronized void handleCompletedTaskState(TaskStatus status, SingularityTaskId taskIdObj, ExtendedTaskState taskState, SingularityCreateResult taskHistoryUpdateCreateResult, Optional<SingularityTask> task, long timestamp, boolean isActiveTask) { // Method synchronized to prevent race condition where two tasks complete at the same time but the leader cache holding the state // doesn't get updated between each task completion. If this were to happen, then slaves would never transition from DECOMMISSIONING to // DECOMMISSIONED because each task state check thinks the other task is still running. slaveAndRackManager.checkStateAfterFinishedTask(taskIdObj, status.getAgentId().getValue(), leaderCache); scheduler.handleCompletedTask(task, taskIdObj, isActiveTask, timestamp, taskState, taskHistoryUpdateCreateResult, status); }
private synchronized void handleCompletedTaskState(TaskStatus status, SingularityTaskId taskIdObj, ExtendedTaskState taskState, SingularityCreateResult taskHistoryUpdateCreateResult, Optional<SingularityTask> task, long timestamp, boolean isActiveTask) { // Method synchronized to prevent race condition where two tasks complete at the same time but the leader cache holding the state // doesn't get updated between each task completion. If this were to happen, then slaves would never transition from DECOMMISSIONING to // DECOMMISSIONED because each task state check thinks the other task is still running. slaveAndRackManager.checkStateAfterFinishedTask(taskIdObj, status.getAgentId().getValue(), leaderCache); scheduler.handleCompletedTask(task, taskIdObj, isActiveTask, timestamp, taskState, taskHistoryUpdateCreateResult, status); }