maytasm commented on a change in pull request #11553:
URL: https://github.com/apache/druid/pull/11553#discussion_r683606663



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunner.java
##########
@@ -289,13 +289,15 @@ private void stopInternal()
   @Override
   public void collectReport(SubTaskReportType report)
   {
-    taskMonitor.collectReport(report);
+    if (taskMonitor != null) {
+      taskMonitor.collectReport(report);
+    }

Review comment:
       I just saw that the `taskMonitor` was accessed without a null check so I 
added the null check just in case. The bug mentioned in this ticket can be fix 
with just the change in `getReports()`. Given the context from your comment, 
maybe it is better to leave it as is and adds a comment mentioning something 
like... collectReport is only called when there is a subtask sending its 
report. Since TaskMonitor is responsible for spawning subtasks, the taskMonitor 
cannot be null`

##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunner.java
##########
@@ -289,13 +289,15 @@ private void stopInternal()
   @Override
   public void collectReport(SubTaskReportType report)
   {
-    taskMonitor.collectReport(report);
+    if (taskMonitor != null) {
+      taskMonitor.collectReport(report);
+    }

Review comment:
       I just saw that the `taskMonitor` was accessed without a null check so I 
added the null check just in case. The bug mentioned in this ticket can be fix 
with just the change in `getReports()`. Given the context from your comment, 
maybe it is better to leave it as is and adds a comment mentioning something 
like... collectReport is only called when there is a subtask sending its 
report. Since TaskMonitor is responsible for spawning subtasks, the taskMonitor 
cannot be null




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