suneet-s commented on a change in pull request #12100:
URL: https://github.com/apache/druid/pull/12100#discussion_r778421280



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java
##########
@@ -583,7 +583,7 @@ private void addWorker(final Worker 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())) {
+              if (w != null && w.getHost().equals(worker.getHost()) && 
e.getValue().getTask() != null) {

Review comment:
       I do not know this part of the system well, but I found a couple other 
places where this is called without a null check - `getPendingTaskPayloads` and 
`runTaskOnWorker`.
   
   Could you annotate `HttpRemoteTaskRunner#getTask` with `@Nullable` so we can 
use intelliJ inspections to catch any uses of `getTask` without a null check.




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