Ensure we not log missleading errors if the promise was already failed due errors

Motivation:

In DefaultHttp2ConnectionEncoder we fail the promise in in the FlowControlledData.error(...) method but also add it the CoalescingBufferQueue. Which can lead to have the promise failed by error(...) before it can be failed in CoalescingBufferQueue.

This can lead to confusing and missleading errors in the log like:
    2016-08-12 09:47:43,716       nettyIoExecutorGroup-1-9 [WARN ] PromiseNotifier                - Failed to mark a promise as failure because it's done already: DefaultChannelPromise@374225e0(failure: javax.net.ssl.SSLException: SSLEngine closed already)
    javax.net.ssl.SSLException: SSLEngine closed already
        at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source) ~[netty-all-4.1.5.Final-SNAPSHOT.jar:?]

Modifications:

Ensure we only fail the queue (which will also fail the promise).

Result:

No more missleading logs.
This commit is contained in:
Norman Maurer 2016-08-12 11:15:46 +02:00
parent 6d70f4b38a
commit 5fd239c29c

View File

@ -356,7 +356,6 @@ public class DefaultHttp2ConnectionEncoder implements Http2ConnectionEncoder {
// Don't update dataSize because we need to ensure the size() method returns a consistent size even after // Don't update dataSize because we need to ensure the size() method returns a consistent size even after
// error so we don't invalidate flow control when returning bytes to flow control. // error so we don't invalidate flow control when returning bytes to flow control.
lifecycleManager.onError(ctx, cause); lifecycleManager.onError(ctx, cause);
promise.tryFailure(cause);
} }
@Override @Override