use of com.netflix.titus.master.kubernetes.client.model.PodNotFoundEvent in project titus-control-plane by Netflix.
the class DefaultKubeJobManagementReconciler method publishPodEvent.
private void publishPodEvent(Task task, TaskStatus finalTaskStatus) {
PodNotFoundEvent podEvent = PodEvent.onPodNotFound(task, finalTaskStatus);
logger.debug("Publishing pod event: {}", podEvent);
podEventSink.next(podEvent);
}
use of com.netflix.titus.master.kubernetes.client.model.PodNotFoundEvent in project titus-control-plane by Netflix.
the class KubeNotificationProcessor method processEvent.
private Mono<Void> processEvent(PodEvent event) {
Pair<Job<?>, Task> jobAndTask = v3JobOperations.findTaskById(event.getTaskId()).orElse(null);
if (jobAndTask == null) {
logger.warn("Got Kube notification about unknown task: {}", event.getTaskId());
return Mono.empty();
}
Task task = jobAndTask.getRight();
if (event instanceof PodNotFoundEvent) {
return handlePodNotFoundEvent((PodNotFoundEvent) event);
}
// TODO Implement flatMapWithSequentialSubscription operator
return handlePodUpdatedEvent(event, jobAndTask.getLeft(), task);
}
use of com.netflix.titus.master.kubernetes.client.model.PodNotFoundEvent in project titus-control-plane by Netflix.
the class KubeNotificationProcessor method handlePodNotFoundEvent.
private Mono<Void> handlePodNotFoundEvent(PodNotFoundEvent event) {
Task task = event.getTask();
logger.info("Pod not found event: taskId={}, finalTaskStatus={}", task.getId(), event.getFinalTaskStatus());
return ReactorExt.toMono(v3JobOperations.updateTask(task.getId(), currentTask -> {
List<TaskStatus> newHistory = CollectionsExt.copyAndAdd(currentTask.getStatusHistory(), currentTask.getStatus());
Task updatedTask = currentTask.toBuilder().withStatus(event.getFinalTaskStatus()).withStatusHistory(newHistory).build();
metricsChangesApplied.increment();
return Optional.of(updatedTask);
}, V3JobOperations.Trigger.Kube, "Pod status updated from kubernetes node, it couldn't find the pod " + task.getId(), KUBE_CALL_METADATA));
}
Aggregations