416321 handle failure during blocked committing write

This commit is contained in:
Greg Wilkins 2013-09-02 14:44:23 +10:00
parent 317a3f27df
commit 07ae3615ed
3 changed files with 29 additions and 11 deletions

View File

@ -410,9 +410,16 @@ public abstract class AbstractConnection implements Connection
}
@Override
public void failed(Throwable x)
public void failed(final Throwable x)
{
onFillInterestedFailed(x);
_executor.execute(new Runnable()
{
@Override
public void run()
{
onFillInterestedFailed(x);
}
});
}
@Override

View File

@ -291,12 +291,12 @@ public class SslConnection extends AbstractConnection
}
@Override
public void failed(Throwable x)
public void failed(final Throwable x)
{
// This means that a write of data has failed. Writes are done
// only if there is an active writeflusher or a read needed to write
// data. In either case the appropriate callback is passed on.
boolean failFiller = false;
boolean fail_filler = false;
synchronized (DecryptedEndPoint.this)
{
if (DEBUG)
@ -309,12 +309,23 @@ public class SslConnection extends AbstractConnection
if (_fillRequiresFlushToProgress)
{
_fillRequiresFlushToProgress = false;
failFiller = true;
fail_filler = true;
}
}
if (failFiller)
getFillInterest().onFail(x);
getWriteFlusher().onFail(x);
final boolean filler_failed=fail_filler;
getExecutor().execute(new Runnable()
{
@Override
public void run()
{
if (filler_failed)
getFillInterest().onFail(x);
getWriteFlusher().onFail(x);
}
});
}
};

View File

@ -722,8 +722,8 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
if (x instanceof EofException)
{
LOG.debug(x);
_response.getHttpOutput().closed();
_callback.failed(x);
_response.getHttpOutput().closed();
}
else
{
@ -733,16 +733,16 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
@Override
public void succeeded()
{
_response.getHttpOutput().closed();
_callback.failed(x);
_response.getHttpOutput().closed();
}
@Override
public void failed(Throwable th)
{
LOG.ignore(th);
_response.getHttpOutput().closed();
_callback.failed(x);
_response.getHttpOutput().closed();
}
});
}