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 10:00:36 UTC
[GitHub] [shardingsphere-elasticjob-lite] Technoboy- commented on issue #860: Run JobSpringNamespaceWithEventTraceRdbTest throw NPE
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