ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Bondar <avia...@yandex.ru>
Subject Re: SchedulerFuture.nextExecutionTime() throws ArrayIndexOutOfBoundsException
Date Tue, 02 Feb 2016 05:05:04 GMT
<div>I am not familiar with this API, but it seems these is a bug in sources of this
ignite branch (and in master too)</div><div><br /><p>408: public long[]
nextExecutionTimes(int cnt, long start) {<br /> 409:    assert cnt &gt; 0;<br
/>410:    assert start &gt; 0;<br />411<br />412:    if (isDone() ||
isCancelled())<br />413:        return EMPTY_TIMES;</p></div><div><p>436:
public long nextExecutionTime() {<br />437:    return nextExecutionTimes(1, U.currentTimeMillis())[0];<br
/>438: }<br /><br />So in case when (isDone() || isCancelled())==true we have EMPTY_TIMES[0]
at line# 437</p></div><div> </div><div>02.02.2016, 05:04, "Steve
Scheck" &lt;sscheck@silverspringnet.com&gt;:</div><blockquote type="cite"><div
style="color:#000000;font-size:14px;font-family:Calibri,sans-serif;"><div>Hello,</div><div> </div><div>When
I schedule a schedule a task with IgniteScheduler.scheduleLocal(), then immediately call SchedulerFuture.nextExecutionTime(),
Ignite throws an exception:</div><div> </div><div><div>   
            SchedulerFuture schedulerFuture = scheduler.scheduleLocal(() -&gt; dispatchNow(job),
cronString);</div><div>                long nextExecutionTime = schedulerFuture.nextExecutionTime();</div></div><div> </div><div><div>java.lang.ArrayIndexOutOfBoundsException:
0</div><div><span style="white-space:pre;"></span>at org.apache.ignite.internal.processors.schedule.ScheduleFutureImpl.nextExecutionTime(ScheduleFutureImpl.java:437)
~[ignite-schedule-1.2.0-incubating.jar!/:1.3.0-incubating]</div></div><div> </div><div>cronString
has the value: {55} 53 3/5 * * * ?</div><div> </div><div>Am I doing
something wrong here? The JavaDoc has no stipulation on when nextExecutionTime() may be called
after a task is scheduled.</div><div> </div><div>Thanks.</div><div> </div><div> </div></div></blockquote><div> </div><div> </div>
View raw message