422723 - Dispatch failed callbacks to avoid blocking selector

Call direct if dispatch rejected
This commit is contained in:
Greg Wilkins 2013-11-28 19:02:33 +11:00
parent 6848186bfa
commit 4e0c1cbcf9
1 changed files with 14 additions and 6 deletions

View File

@ -604,14 +604,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);
}
}
}