jihoonson commented on a change in pull request #6206: Fix NPE in 
KafkaSupervisor.checkpointTaskGroup
URL: https://github.com/apache/incubator-druid/pull/6206#discussion_r212173403
 
 

 ##########
 File path: 
extensions-core/kafka-indexing-service/src/main/java/io/druid/indexing/kafka/supervisor/KafkaSupervisor.java
 ##########
 @@ -1627,11 +1664,15 @@ private void checkPendingCompletionTasks() throws 
ExecutionException, Interrupte
           continue;
         }
 
-        Iterator<Map.Entry<String, TaskData>> iTask = 
group.tasks.entrySet().iterator();
+        Iterator<Entry<String, TaskData>> iTask = 
group.tasks.entrySet().iterator();
         while (iTask.hasNext()) {
-          Map.Entry<String, TaskData> task = iTask.next();
+          final Entry<String, TaskData> entry = iTask.next();
+          final String taskId = entry.getKey();
+          final TaskData taskData = entry.getValue();
+
+          Preconditions.checkNotNull(taskData.status, "task[%s] has a null 
status", taskId);
 
 Review comment:
   This should never happen. NPE would throw if `taskData.status` is null and 
this is just a sanity code to see what's null on the potential NPE. I improved 
the error message.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to