clintropolis 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_r404399519
##########
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:
>You can deduce that the NPE from event.getData() happens from the data map
of the alert and the Exception that was produced
Ah yeah, I know _I can deduce this_, my point was more to be useful for
operators who see an error or alert and don't want to dig through the code,
which is probably most of them, that we could indicate friendlier messaging
that an unexpected situation where the child data was null occurred on a zk
event.
----------------------------------------------------------------
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]