FrankChen021 commented on code in PR #20417:
URL: https://github.com/apache/druid/pull/20417#discussion_r4111353811
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:
##########
@@ -1442,11 +1442,21 @@ public void taskAddedOrUpdated(final TaskAnnouncement
announcement, final Worker
if (knownStatusInStorage.isPresent()) {
switch (knownStatusInStorage.get().getStatusCode()) {
case RUNNING:
+ final Optional<Task> task = taskStorage.getTask(taskId);
+ if (!task.isPresent()) {
+ log.makeAlert(
+ "Could not fetch payload of task[%s] with status[%s]."
+ + " Ignoring notification[%s] from worker[%s].",
+ taskId, knownStatusInStorage.get(), announcement,
worker.getHost()
+ ).emit();
+ break;
Review Comment:
[P1] Do not shut down a task after an ignored payload lookup
**Finding:** When taskStorage reports RUNNING but getTask(taskId) returns
Optional.absent(), this break exits only the switch. taskItem therefore remains
null, and the shared taskItem == null branch below marks shouldShutdownTask for
a non-complete RUNNING announcement; the method then calls
workerHolder.shutdownTask(taskId). A missing or temporarily undecodable payload
can consequently terminate an otherwise running worker task during discovery.
**Suggestion:** Return from the discovery path or otherwise mark this
notification as intentionally ignored so the missing-payload case cannot reach
the generic unknown-task shutdown branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]