Mrhs121 commented on issue #17459:
URL: 
https://github.com/apache/dolphinscheduler/issues/17459#issuecomment-3315197191

   > ```
   > [WI-0][TI-0] - 2025-09-21 01:18:11.696 ERROR [Curator-TreeCache-0] 
o.a.c.f.r.c.TreeCache:[828] - 
   > 
   > java.lang.NullPointerException: null
   > 
   >    at 
org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperTreeCacheListenerAdapter.childEvent(ZookeeperTreeCacheListenerAdapter.java:42)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache.lambda$callListeners$1(TreeCache.java:811)
   > 
   >    at 
org.apache.curator.framework.listen.MappingListenerManager.lambda$forEach$0(MappingListenerManager.java:93)
   > 
   >    at 
org.apache.curator.framework.listen.MappingListenerManager.forEach(MappingListenerManager.java:90)
   > 
   >    at 
org.apache.curator.framework.listen.StandardListenerManager.forEach(StandardListenerManager.java:90)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache.callListeners(TreeCache.java:807)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache.access$1900(TreeCache.java:79)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache$2.run(TreeCache.java:909)
   > 
   >    at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   > 
   >    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   > 
   >    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   > 
   >    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   > 
   >    at java.lang.Thread.run(Thread.java:750)
   > 
   > [WI-0][TI-0] - 2025-09-21 01:18:11.697 INFO  [Curator-TreeCache-0] 
o.a.d.s.m.c.AbstractClusterSubscribeListener:[41] - Server 
MasterServerMetadata(super=BaseServerMetadata(processId=11, 
serverStartupTime=1758388691281, address=172.17.0.4:5678, cpuUsage=0.0, 
memoryUsage=0.4180555562478473, serverStatus=NORMAL)) added
   > 
   > [WI-0][TI-0] - 2025-09-21 01:18:11.698 ERROR [Curator-TreeCache-0] 
o.a.c.f.r.c.TreeCache:[828] - 
   > 
   > java.lang.NullPointerException: null
   > 
   >    at 
org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperTreeCacheListenerAdapter.childEvent(ZookeeperTreeCacheListenerAdapter.java:42)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache.lambda$callListeners$1(TreeCache.java:811)
   > 
   >    at 
org.apache.curator.framework.listen.MappingListenerManager.lambda$forEach$0(MappingListenerManager.java:93)
   > 
   >    at 
org.apache.curator.framework.listen.MappingListenerManager.forEach(MappingListenerManager.java:90)
   > 
   >    at 
org.apache.curator.framework.listen.StandardListenerManager.forEach(StandardListenerManager.java:90)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache.callListeners(TreeCache.java:807)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache.access$1900(TreeCache.java:79)
   > 
   >    at 
org.apache.curator.framework.recipes.cache.TreeCache$2.run(TreeCache.java:909)
   > 
   >    at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   > 
   >    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   > 
   >    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   > 
   >    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   > 
   >    at java.lang.Thread.run(Thread.java:750)
   > ```
   > 
   > master启动后NPE错误,不管plguins是有还是没有
   
   
   
看了下curator的代码,先解释下为什么会抛NPE,当event为以下四种类型的时候,data默认就是null,dolphin在处理的时候没有判断data为null的情况,直接调用了`final
 String eventPath = event.getData().getPath();`获取path,所以抛NPE了。
   
   <img width="969" height="214" alt="Image" 
src="https://github.com/user-attachments/assets/a9102f79-fb7e-4a0e-9136-9623f76870e8";
 />
   <img width="716" height="106" alt="Image" 
src="https://github.com/user-attachments/assets/e96b6a44-b6f1-4a76-9637-0048a8bbc175";
 />
   
   
但是这个NPE不会影响到master的正常启动,可以看到curator在调用childEvent的时候并没有在向上抛出异常,只是简单的讲错误信息打印出来而已
   
   <img width="796" height="279" alt="Image" 
src="https://github.com/user-attachments/assets/014bc58e-20f4-44d2-af5c-85126ef7fb53";
 />
   <img width="806" height="452" alt="Image" 
src="https://github.com/user-attachments/assets/5c268bb4-3e98-41d2-adc5-1793c4ab2943";
 />


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

Reply via email to