Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常 #92

Closed
gaoyaqiu opened this issue May 18, 2016 · 0 comments
Labels

Comments

@gaoyaqiu
Copy link

资源: 1台服务器(job和zk在一起), 不能发图我就发代码了。
代码如下:

  1. main方法
    public static void main(final String[] args) {
    ZookeeperConfiguration zkConfig = new ZookeeperConfiguration("localhost:2181", "cy-job", 1000, 3000, 3);
    CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(zkConfig);
    regCenter.init();
 JobConfiguration jc1 = new JobConfiguration("999", SimpleJobDemo.class, 3, "0/10 * * * * ?");           
 jc1.setShardingItemParameters("0=a,1=b,2=c");                                                           
 new JobScheduler(regCenter, jc1, new OnceJobListener(1000, 10000)).init();                              

}

  1. 监听使用的是仅单一节点执行的监听
    public class OnceJobListener extends AbstractDistributeOnceElasticJobListener {

    public OnceJobListener(long startedTimeoutMilliseconds, long completedTimeoutMilliseconds) {
    super(startedTimeoutMilliseconds, completedTimeoutMilliseconds);
    }

    @OverRide
    public void doBeforeJobExecutedAtLastStarted(JobExecutionMultipleShardingContext shardingContext) {
    System.out.println("任务执行前监听");
    }

    @OverRide
    public void doAfterJobExecutedAtLastCompleted(JobExecutionMultipleShardingContext shardingContext) {
    System.out.println("任务执行后监听");
    }
    }

  2. 启动job
    监听日志正常输出

  3. 修改分片参数
    我是在监控平台帮分片修改为1,分片序号修改为0=a,保存。

  4. 控制台监听报异常

[JOB] 2016-05-18-22:26:23.486 [DEFAULT.999_Scheduler_Worker-1] ERROR c.d.d.j.p.j.t.s.AbstractSimpleElasticJob - Elastic job: exception occur in job processing...
com.dangdang.ddframe.job.exception.JobTimeoutException: Job timeout. timeout mills is 10000.
at com.dangdang.ddframe.job.api.listener.AbstractDistributeOnceElasticJobListener.afterJobExecuted(AbstractDistributeOnceElasticJobListener.java:99) ~[elastic-job-core-1.0.6.jar:na]
at com.dangdang.ddframe.job.internal.schedule.JobFacade.afterJobExecuted(JobFacade.java:225) ~[elastic-job-core-1.0.6.jar:na]
at com.dangdang.ddframe.job.internal.job.AbstractElasticJob.execute(AbstractElasticJob.java:68) ~[elastic-job-core-1.0.6.jar:na]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.2.jar:na]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.2.jar:na]
[JOB] 2016-05-18-22:26:23.492 [DEFAULT.999_Scheduler_Worker-1] DEBUG c.d.d.r.e.RegExceptionHandler - Elastic job: ignored exception for: KeeperErrorCode = NoNode for /cy-job/999/offset/0

@terrymanu terrymanu changed the title 1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常 [Bug] 1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常 May 19, 2016
@terrymanu terrymanu changed the title [Bug] 1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常 1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常 Jul 12, 2016
@terrymanu terrymanu added the bug label Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants