kgyrtkirk commented on code in PR #18510:
URL: https://github.com/apache/druid/pull/18510#discussion_r2356105056


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:
##########
@@ -611,17 +612,18 @@ void addWorker(final Worker worker)
           // tasks that we think are running on this worker. Provide that 
information to WorkerHolder that
           // manages the task syncing with that worker.
           for (Map.Entry<String, HttpRemoteTaskRunnerWorkItem> e : 
tasks.entrySet()) {
-            if (e.getValue().getState() == 
HttpRemoteTaskRunnerWorkItem.State.RUNNING) {
-              Worker w = e.getValue().getWorker();
-              if (w != null && w.getHost().equals(worker.getHost()) && 
e.getValue().getTask() != null) {
-                expectedAnnouncements.add(
-                    TaskAnnouncement.create(
-                        e.getValue().getTask(),
-                        TaskStatus.running(e.getKey()),
-                        e.getValue().getLocation()
-                    )
-                );
-              }
+            HttpRemoteTaskRunnerWorkItem workItem = e.getValue();
+            if (workItem.isRunningOnWorker(worker)) {
+              expectedAnnouncements.add(
+                  TaskAnnouncement.create(
+                      workItem.getTaskId(),
+                      workItem.getTaskType(),
+                      null,

Review Comment:
   I think those questions can't really be answered without the `Task` object - 
   these fake announcements will only be used to generate the task disappeared 
event....
   
   the "damage" that when an overlord detects an unknown task running on a 
worker when it starts is already accepted ...see 
[here](https://github.com/apache/druid/blame/4fc154232e6789f8ce8020a7d286f55e61ce0f7d/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java#L1541)
   



-- 
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]

Reply via email to