Improved logging.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2020-11-27 13:43:09 +01:00
parent 54924213e8
commit a241b9dd5e
6 changed files with 11 additions and 9 deletions

View File

@ -142,7 +142,6 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
BufferUtil.put(networkBuffer.getBuffer(), upgradeBuffer);
BufferUtil.flipToFlush(upgradeBuffer, 0);
}
releaseNetworkBuffer();
return upgradeBuffer;
}

View File

@ -115,7 +115,7 @@ public class HttpChannelOverFCGI extends HttpChannel
public boolean failAllContent(Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("failing all content with {}", (Object)failure);
LOG.debug("failing all content with {} {}", failure, this);
List<HttpInput.Content> copy;
try (AutoLock l = _lock.lock())
{

View File

@ -545,7 +545,7 @@ public class HttpChannelOverHTTP2 extends HttpChannel implements Closeable, Writ
{
HttpInput.Content c = _content.get();
if (LOG.isDebugEnabled())
LOG.debug("failing current content: {} with failure: {}", c, failure);
LOG.debug("failing current content {} with {} {}", c, failure, this);
if (c == null)
return false;
if (c.isSpecial())
@ -591,7 +591,7 @@ public class HttpChannelOverHTTP2 extends HttpChannel implements Closeable, Writ
public boolean failAllContent(Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("failing all content with {}", (Object)failure);
LOG.debug("failing all content with {} {}", failure, this);
boolean atEof = getStream().failAllData(failure);
atEof |= _contentDemander.failContent(failure);
if (LOG.isDebugEnabled())

View File

@ -162,12 +162,12 @@ class AsyncContentProducer implements ContentProducer
private void failCurrentContent(Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("failing currently held content {}", this, x);
if (_transformedContent != null && !_transformedContent.isSpecial())
{
if (_transformedContent != _rawContent)
{
if (LOG.isDebugEnabled())
LOG.debug("failing currently held transformed content {} {}", x, this);
_transformedContent.skip(_transformedContent.remaining());
_transformedContent.failed(x);
}
@ -176,6 +176,8 @@ class AsyncContentProducer implements ContentProducer
if (_rawContent != null && !_rawContent.isSpecial())
{
if (LOG.isDebugEnabled())
LOG.debug("failing currently held raw content {} {}", x, this);
_rawContent.skip(_rawContent.remaining());
_rawContent.failed(x);
_rawContent = null;

View File

@ -129,7 +129,7 @@ public class HttpChannelOverHttp extends HttpChannel implements HttpParser.Reque
public boolean failAllContent(Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("failing all content with {}", (Object)failure);
LOG.debug("failing all content with {} {}", failure, this);
if (_content != null)
{
if (_content.isSpecial())

View File

@ -130,9 +130,10 @@ public class HttpInput extends ServletInputStream implements Runnable
public boolean consumeAll()
{
IOException failure = new IOException("Unconsumed content");
if (LOG.isDebugEnabled())
LOG.debug("consumeAll {}", this);
boolean atEof = _contentProducer.consumeAll(new IOException("Unconsumed content"));
LOG.debug("consumeAll {}", this, failure);
boolean atEof = _contentProducer.consumeAll(failure);
if (atEof)
_consumedEof = true;