maytasm commented on a change in pull request #9610: Fix NPE in 
RemoteTaskRunner event handler causes JVM shutdown
URL: https://github.com/apache/druid/pull/9610#discussion_r404593305
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
 ##########
 @@ -1081,6 +979,117 @@ private boolean cancelWorkerCleanup(String workerHost)
     }
   }
 
+  @VisibleForTesting
+  PathChildrenCacheListener getStatusListener(final Worker worker, final 
ZkWorker zkWorker, final SettableFuture<ZkWorker> retVal)
+  {
+    return (client, event) -> {
+      final String taskId;
+      final RemoteTaskRunnerWorkItem taskRunnerWorkItem;
+      synchronized (statusLock) {
+        try {
+          switch (event.getType()) { // lgtm 
[java/dereferenced-value-may-be-null]
+            case CHILD_ADDED:
+            case CHILD_UPDATED:
+              taskId = ZKPaths.getNodeFromPath(event.getData().getPath()); // 
lgtm [java/dereferenced-value-may-be-null]
 
 Review comment:
   - Confirmed that event cannot be null. Removed null check for the event.
   - Added a separate catch block for NPE with a different alert message than 
the existing message for catching any Exception. This should be more helpful to 
operators. Let me know if you have suggestion on different wording or other KV 
data to add to alert.
    

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