368240: Improved handling of dispatch failure
This commit is contained in:
parent
a7783ae568
commit
8fcc22df32
|
@ -260,7 +260,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
|
|||
for (int i=0;i<getSelectSets();i++)
|
||||
{
|
||||
final int id=i;
|
||||
dispatch(new Runnable()
|
||||
boolean selecting=dispatch(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
|
@ -303,6 +303,9 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
if (!selecting)
|
||||
throw new IllegalStateException("!Selecting");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,8 @@ public abstract class AbstractConnector extends AggregateLifeCycle implements Ht
|
|||
_acceptorThread = new Thread[getAcceptors()];
|
||||
|
||||
for (int i = 0; i < _acceptorThread.length; i++)
|
||||
_threadPool.dispatch(new Acceptor(i));
|
||||
if (!_threadPool.dispatch(new Acceptor(i)))
|
||||
throw new IllegalStateException("!accepting");
|
||||
if (_threadPool.isLowOnThreads())
|
||||
LOG.warn("insufficient threads configured for {}",this);
|
||||
}
|
||||
|
|
|
@ -363,6 +363,7 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo
|
|||
return true;
|
||||
}
|
||||
}
|
||||
LOG.debug("Dispatched {} to stopped {}",job,this);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue