elastic-job,zk关闭问题

小番茄 发布于 2017/06/08 10:14
阅读 3K+
收藏 0

通过程序添加一个任务让任务跑起来,然后睡眠几秒,之后关闭注册中心会发现程序依旧有在调用。

com.dangdang.ddframe.job.reg.exception.RegException: java.lang.IllegalStateException: instance must be started before calling this method
    at com.dangdang.ddframe.job.reg.exception.RegExceptionHandler.handleException(RegExceptionHandler.java:49) ~[elastic-job-common-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.getDirectly(ZookeeperRegistryCenter.java:162) ~[elastic-job-common-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.get(ZookeeperRegistryCenter.java:143) ~[elastic-job-common-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.lite.internal.storage.JobNodeStorage.getJobNodeData(JobNodeStorage.java:72) ~[elastic-job-lite-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.lite.internal.config.ConfigurationService.load(ConfigurationService.java:54) ~[elastic-job-lite-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.lite.internal.schedule.LiteJobFacade.loadJobRootConfiguration(LiteJobFacade.java:78) ~[elastic-job-lite-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.lite.internal.schedule.LiteJobFacade.loadJobRootConfiguration(LiteJobFacade.java:49) ~[elastic-job-lite-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.executor.AbstractElasticJobExecutor.<init>(AbstractElasticJobExecutor.java:65) ~[elastic-job-common-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.executor.type.SimpleJobExecutor.<init>(SimpleJobExecutor.java:35) ~[elastic-job-common-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.executor.JobExecutorFactory.getJobExecutor(JobExecutorFactory.java:51) ~[elastic-job-common-core-2.1.3.jar:na]
    at com.dangdang.ddframe.job.lite.internal.schedule.LiteJob.execute(LiteJob.java:26) ~[elastic-job-lite-core-2.1.3.jar:na]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.2.1.jar:na]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:na]
Caused by: java.lang.IllegalStateException: instance must be started before calling this method
    at com.google.common.base.Preconditions.checkState(Preconditions.java:173) ~[guava-18.0.jar:na]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.getData(CuratorFrameworkImpl.java:375) ~[curator-framework-2.10.0.jar:na]
    at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.getDirectly(ZookeeperRegistryCenter.java:158) ~[elastic-job-common-core-2.1.3.jar:na]
    ... 11 common frames omitted
[ERROR] 2017-06-08 10:10:10,014 --9811a376-a79d-4aa5-8bba-04914b4767a7_Worker-1-- [org.quartz.core.ErrorLogger] Job (DEFAULT.9811a376-a79d-4aa5-8bba-04914b4767a7 threw an exception. 
org.quartz.SchedulerException: Job threw an unhandled exception.
    at org.quartz.core.JobRunShell.run(JobRunShell.java:213) ~[quartz-2.2.1.jar:na]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:na]

加载中
0
亮_ShardingSphere
亮_ShardingSphere

只是关了zk的连接,并未关闭作业,作业不会停止调度。reg.close仅用于进程退出时回收资源。

返回顶部
顶部