You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/01/04 22:11:00 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #12100: Fix NullpointerException trigger middlemanager unusable when using httpRemote

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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org