[JBoss JIRA] Created: (NETTY-379) Intermittent slippery task timeout in HashedWheelTimer
Trustin Lee (JIRA)
jira-events at lists.jboss.org
Mon Jan 31 00:47:47 EST 2011
Intermittent slippery task timeout in HashedWheelTimer
------------------------------------------------------
Key: NETTY-379
URL: https://issues.jboss.org/browse/NETTY-379
Project: Netty
Issue Type: Bug
Affects Versions: 3.2.3.Final, 3.2.2.Final, 3.2.1.Final, 3.2.0.Final
Reporter: Trustin Lee
Assignee: Trustin Lee
Fix For: 3.2.4.Final
Reported by Saibee Kollarmalil:
@Test
public void hashedWheelTimerTest() throws InterruptedException {
final HashedWheelTimer timer = new HashedWheelTimer(1,
TimeUnit.MILLISECONDS);
final long start = new Date().getTime();
final CountDownLatch latch = new CountDownLatch(10);
sheduleTaskWithDelay(timer, start, latch);
latch.await();
}
private void sheduleTaskWithDelay(final HashedWheelTimer timer, final
long start, final CountDownLatch latch) {
timer.newTimeout(new TimerTask() {
@Override
public void run(Timeout timeout) throws Exception {
log.info("action time " + (new Date().getTime()-start));
latch.countDown();
sheduleTaskWithDelay(timer, start, latch);
}}, 1, TimeUnit.MILLISECONDS);
}
The above test code produces the following out put. Notice the ~500ms gaps
introduced at random intervals. Any suggestions on how to resolve this?
Dec 28, 2010 4:16:51 PM TimerPoolTest$3 run
INFO: action time 14
Dec 28, 2010 4:16:51 PM TimerPoolTest$3 run
INFO: action time 528
Dec 28, 2010 4:16:51 PM TimerPoolTest$3 run
INFO: action time 530
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1044
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1558
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1560
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1562
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1564
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1566
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1568
Dec 28, 2010 4:16:52 PM TimerPoolTest$3 run
INFO: action time 1593
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the netty-dev
mailing list