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/07/01 11:46:15 UTC
[GitHub] [shardingsphere-elasticjob-lite] mmx1960 commented on issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE
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