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,14 +715,22 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
public void failed(final Throwable x)
{
super.failed(x);
getExecutor().execute(new Runnable()
try
{
@Override
public void run()
getExecutor().execute(new Runnable()
{
_callback.failed(x);
}
});
@Override
public void run()
{
_callback.failed(x);
}
});
}
catch (RejectedExecutionException e)
{
LOG.debug(e);
_callback.failed(x);
}
}
}