[#2159] Not fail the ChannelPromise with WriteTimeoutException to prevent warning

This commit is contained in:
Norman Maurer 2014-01-29 13:56:42 +01:00
parent 80ed147652
commit 37e6588845

View File

@ -112,8 +112,10 @@ public class WriteTimeoutHandler extends ChannelOutboundHandlerAdapter {
final ScheduledFuture<?> sf = ctx.executor().schedule(new Runnable() {
@Override
public void run() {
if (future.tryFailure(WriteTimeoutException.INSTANCE)) {
// If succeeded to mark as failure, notify the pipeline, too.
// Was not written yet so issue a write timeout
// The future itself will be failed with a ClosedChannelException once the close() was issued
// See https://github.com/netty/netty/issues/2159
if (!future.isDone()) {
try {
writeTimedOut(ctx);
} catch (Throwable t) {