You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/28 17:08:26 UTC

[GitHub] [shardingsphere-elasticjob-lite] terrymanu opened a new issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE

terrymanu opened a new issue #860:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/860


   When run `JobSpringNamespaceWithEventTraceRdbTest` will throw NPE, but not effect test result.
   
   The exception is:
   
   ```
   [ERROR] 2020-06-29 01:05:36,357 --Curator-TreeCache-1-- [org.apache.curator.framework.recipes.cache.TreeCache]  
   java.lang.NullPointerException: null
   	at java.io.StringReader.<init>(StringReader.java:50) ~[na:1.8.0_151]
   	at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:63) ~[snakeyaml-1.26.jar:na]
   	at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:452) ~[snakeyaml-1.26.jar:na]
   	at org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine.unmarshal(YamlEngine.java:49) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService.load(ConfigurationService.java:60) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverListenerManager.isFailoverEnabled(FailoverListenerManager.java:69) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverListenerManager.access$000(FailoverListenerManager.java:38) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverListenerManager$JobCrashedJobListener.dataChanged(FailoverListenerManager.java:77) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractJobListener.childEvent(AbstractJobListener.java:42) ~[classes/:na]
   	at org.apache.curator.framework.recipes.cache.TreeCache$2.apply(TreeCache.java:732) [curator-recipes-2.10.0.jar:na]
   	at org.apache.curator.framework.recipes.cache.TreeCache$2.apply(TreeCache.java:726) [curator-recipes-2.10.0.jar:na]
   	at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:93) [curator-framework-2.10.0.jar:na]
   	at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) [guava-18.0.jar:na]
   	at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:85) [curator-framework-2.10.0.jar:na]
   	at org.apache.curator.framework.recipes.cache.TreeCache.callListeners(TreeCache.java:725) [curator-recipes-2.10.0.jar:na]
   	at org.apache.curator.framework.recipes.cache.TreeCache.access$1400(TreeCache.java:71) [curator-recipes-2.10.0.jar:na]
   	at org.apache.curator.framework.recipes.cache.TreeCache$4.run(TreeCache.java:843) [curator-recipes-2.10.0.jar:na]
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151]
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151]
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
   	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
   ```
   
   It seems like the failover listener is called before job configuration persist to reg center.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob-lite] terrymanu closed issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #860:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/860


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob-lite] mmx1960 commented on issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE

Posted by GitBox <gi...@apache.org>.
mmx1960 commented on issue #860:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/860#issuecomment-652370594


   > Comment to explain the reason:
   > 
   > 1. JobSpringNamespaceWithEventTraceRdbTest will invoke tearDown and execute JobRegistry.getInstance().shutdown().
   > 2. Focus on JobRegistry#shutdown:
   > 
   > ```
   > public void shutdown(final String jobName) {
   >         JobScheduleController scheduleController = schedulerMap.remove(jobName);
   >         if (null != scheduleController) {
   >            //A. Will trigger JobShutdownHookPlugin#shutdown and remove instance node by : new InstanceService(regCenter, jobName).removeInstance();
   >            //B. Trigger FailoverListenerManager$JobCrashedJobListener asynchronously
   >             scheduleController.shutdown();
   >         }
   >         CoordinatorRegistryCenter regCenter = regCenterMap.remove(jobName);
   >         if (null != regCenter) {
   >            //C. Will invoke TreeCache.close, but interrupt the thread of JobCrashedJobListener, spread to regCenter.getDirectly to return null.  And let YamlEngine to unmarshal a null value.
   >             regCenter.evictCacheData("/" + jobName);
   >         }
   >         jobInstanceMap.remove(jobName);
   >         jobRunningMap.remove(jobName);
   >         currentShardingTotalCountMap.remove(jobName);
   >     }
   > ```
   this can avoid the NPE :
   when enter FailoverListener#dataChanged ,decide and return if job is shutdown .  
   
   i will fix this issue later.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob-lite] terrymanu commented on issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #860:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/860#issuecomment-650897822


   @EasonFeng5870 Thank you, assigned.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob-lite] EasonFeng5870 commented on issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE

Posted by GitBox <gi...@apache.org>.
EasonFeng5870 commented on issue #860:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/860#issuecomment-650798464


   please assign it to me, thanks.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob-lite] Technoboy- commented on issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on issue #860:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/860#issuecomment-652322277


   Comment to explain the reason:
   1. JobSpringNamespaceWithEventTraceRdbTest will invoke tearDown and execute JobRegistry.getInstance().shutdown().
   2. Focus on JobRegistry#shutdown:
   ```
   public void shutdown(final String jobName) {
           JobScheduleController scheduleController = schedulerMap.remove(jobName);
           if (null != scheduleController) {
              //A. Will trigger JobShutdownHookPlugin#shutdown and remove instance node by : new InstanceService(regCenter, jobName).removeInstance();
              //B. Trigger FailoverListenerManager$JobCrashedJobListener asynchronously
               scheduleController.shutdown();
           }
           CoordinatorRegistryCenter regCenter = regCenterMap.remove(jobName);
           if (null != regCenter) {
              //C. Will invoke TreeCache.close, but interrupt the thread of JobCrashedJobListener, spread to regCenter.getDirectly to return null.  And let YamlEngine to unmarshal a null value.
               regCenter.evictCacheData("/" + jobName);
           }
           jobInstanceMap.remove(jobName);
           jobRunningMap.remove(jobName);
           currentShardingTotalCountMap.remove(jobName);
       }
   ```


----------------------------------------------------------------
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:
users@infra.apache.org