I am not familiar with this API, but it seems these is a bug in sources of this ignite branch (and in master too)

408: public long[] nextExecutionTimes(int cnt, long start) {
409:    assert cnt > 0;
410:    assert start > 0;
411
412:    if (isDone() || isCancelled())
413:        return EMPTY_TIMES;

436: public long nextExecutionTime() {
437:    return nextExecutionTimes(1, U.currentTimeMillis())[0];
438: }

So in case when (isDone() || isCancelled())==true we have EMPTY_TIMES[0] at line# 437

 
02.02.2016, 05:04, "Steve Scheck" <[email protected]>:
Hello,
 
When I schedule a schedule a task with IgniteScheduler.scheduleLocal(), then immediately call SchedulerFuture.nextExecutionTime(), Ignite throws an exception:
 
                SchedulerFuture schedulerFuture = scheduler.scheduleLocal(() -> dispatchNow(job), cronString);
                long nextExecutionTime = schedulerFuture.nextExecutionTime();
 
java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.ignite.internal.processors.schedule.ScheduleFutureImpl.nextExecutionTime(ScheduleFutureImpl.java:437) ~[ignite-schedule-1.2.0-incubating.jar!/:1.3.0-incubating]
 
cronString has the value: {55} 53 3/5 * * * ?
 
Am I doing something wrong here? The JavaDoc has no stipulation on when nextExecutionTime() may be called after a task is scheduled.
 
Thanks.
 
 
 
 

Reply via email to