422723 - Dispatch failed callbacks to avoid blocking selector

Handled rejected execution exception
This commit is contained in:
Greg Wilkins 2013-12-05 10:14:52 +11:00
parent ebd0ad90e0
commit 9c39b2e631
1 changed files with 14 additions and 6 deletions

View File

@ -715,6 +715,8 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
public void failed(final Throwable x)
{
super.failed(x);
try
{
getExecutor().execute(new Runnable()
{
@Override
@ -724,6 +726,12 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
}
});
}
catch (RejectedExecutionException e)
{
LOG.debug(e);
_callback.failed(x);
}
}
}
}