[#2159] Not fail the ChannelPromise with WriteTimeoutException to prevent warning
This commit is contained in:
parent
96f94cfcb1
commit
b3e4122499
@ -111,8 +111,10 @@ public class WriteTimeoutHandler extends ChannelHandlerAdapter {
|
|||||||
final ScheduledFuture<?> sf = ctx.executor().schedule(new Runnable() {
|
final ScheduledFuture<?> sf = ctx.executor().schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (future.tryFailure(WriteTimeoutException.INSTANCE)) {
|
// Was not written yet so issue a write timeout
|
||||||
// If succeeded to mark as failure, notify the pipeline, too.
|
// 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 {
|
try {
|
||||||
writeTimedOut(ctx);
|
writeTimedOut(ctx);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
Loading…
Reference in New Issue
Block a user