Not log notify failure for DelegatingChannelPromiseNotifier when promise is VoidChannelPromise

Motivation:

We should not log by default if the promise is a VoidChannelPromise as its try* methods will always return false.

Modifications:

Do an instanceof check to determine if we should log or not by default

Result:

No more noise in the logs when using a VoidChannelPromise.
This commit is contained in:
Norman Maurer 2017-09-06 14:01:42 +02:00
parent e500755086
commit a739d89792

View File

@ -36,7 +36,7 @@ public final class DelegatingChannelPromiseNotifier implements ChannelPromise, C
private final boolean logNotifyFailure;
public DelegatingChannelPromiseNotifier(ChannelPromise delegate) {
this(delegate, true);
this(delegate, !(delegate instanceof VoidChannelPromise));
}
public DelegatingChannelPromiseNotifier(ChannelPromise delegate, boolean logNotifyFailure) {