Issue #3989 - Select Failure does not attempt to restart selector
+ Changes from PR review Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
20f7a473ee
commit
d8efb62d13
|
@ -107,16 +107,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
|
||||||
protected void doStart() throws Exception
|
protected void doStart() throws Exception
|
||||||
{
|
{
|
||||||
super.doStart();
|
super.doStart();
|
||||||
startSelector();
|
|
||||||
|
|
||||||
// Set started only if we really are started
|
|
||||||
Start start = new Start();
|
|
||||||
submit(start);
|
|
||||||
start._started.await();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void startSelector() throws IOException, InterruptedException
|
|
||||||
{
|
|
||||||
_selector = _selectorManager.newSelector();
|
_selector = _selectorManager.newSelector();
|
||||||
|
|
||||||
// The producer used by the strategies will never
|
// The producer used by the strategies will never
|
||||||
|
@ -129,8 +120,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
|
||||||
|
|
||||||
protected void onSelectFailed(Throwable cause) throws Exception
|
protected void onSelectFailed(Throwable cause) throws Exception
|
||||||
{
|
{
|
||||||
LOG.info("Restarting selector: " + toString(), cause);
|
// override to change behavior
|
||||||
startSelector();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifySelectFailed(Throwable cause)
|
private void notifySelectFailed(Throwable cause)
|
||||||
|
@ -512,7 +502,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
|
||||||
Selector selector = _selector;
|
Selector selector = _selector;
|
||||||
if (isRunning())
|
if (isRunning())
|
||||||
{
|
{
|
||||||
LOG.warn(x);
|
LOG.warn("Fatal select() failure", x);
|
||||||
notifySelectFailed(x);
|
notifySelectFailed(x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue