[JBoss JIRA] Closed: (NETTY-365) HashedWheelTimer.stop() enters an infinite loop when called from TimerTask
Trustin Lee (JIRA)
jira-events at lists.jboss.org
Mon Jan 31 00:53:39 EST 2011
[ https://issues.jboss.org/browse/NETTY-365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trustin Lee closed NETTY-365.
-----------------------------
Resolution: Done
Fixed - IllegalStateException is raised to avoid the infinite loop now.
> HashedWheelTimer.stop() enters an infinite loop when called from TimerTask
> --------------------------------------------------------------------------
>
> Key: NETTY-365
> URL: https://issues.jboss.org/browse/NETTY-365
> Project: Netty
> Issue Type: Bug
> Components: Transport
> Affects Versions: 3.2.3.Final
> Reporter: Bruce Lowekamp
> Assignee: Trustin Lee
> Priority: Minor
> Fix For: 3.2.4.Final
>
>
> If a HashedWheelTimer event fires and ultimately the triggered code calls HashedWheelTimer.stop(), it enters an infinite loop.
> The following code:
> boolean interrupted = false;
> 279 while (workerThread.isAlive()) {
> 280 workerThread.interrupt();
> 281 try {
> 282 workerThread.join(100);
> 283 } catch (InterruptedException e) {
> 284 interrupted = true;
> 285 }
> 286 }
> if called by the workerThread, this code just interrrupts itself in an infinite loop.
> I have mixed feelings about this calling pattern, but would like for it to either work (I don't see a reason the worker thread can't run stop here), or if it can't work, to throw an exception. It's a pretty easy pattern to get into with a timeout causing a test to shutdown. Either way, just need to check if the caller is the workerThread, I think.
--
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