Fixes #503 - Wrong request-per-connection counting in MultiplexHttpDestination in case of failures.

This commit is contained in:
Simone Bordet 2016-04-11 13:31:24 +02:00
parent ac4ee8fec4
commit 11242ae1ec
1 changed files with 2 additions and 2 deletions

View File

@ -132,11 +132,11 @@ public abstract class MultiplexHttpDestination<C extends Connection> extends Htt
{
if (LOG.isDebugEnabled())
LOG.debug("Aborted before processing {}: {}", exchange, cause);
requestsPerConnection.decrementAndGet();
// It may happen that the request is aborted before the exchange
// is created. Aborting the exchange a second time will result in
// a no-operation, so we just abort here to cover that edge case.
exchange.abort(cause);
requestsPerConnection.decrementAndGet();
}
else
{
@ -145,12 +145,12 @@ public abstract class MultiplexHttpDestination<C extends Connection> extends Htt
{
if (LOG.isDebugEnabled())
LOG.debug("Send failed {} for {}", result, exchange);
requestsPerConnection.decrementAndGet();
if (result.retry)
{
if (enqueue(getHttpExchanges(), exchange))
return true;
}
request.abort(result.failure);
}
}