Fixed issue: NETTY-191 Raise ChannelClosedException only once when many queued write requests failed.
This commit is contained in:
parent
7c78539cd5
commit
fecfadb853
@ -679,6 +679,7 @@ class NioDatagramWorker implements Runnable {
|
||||
|
||||
private static void cleanUpWriteBuffer(final NioDatagramChannel channel) {
|
||||
Exception cause = null;
|
||||
boolean fireExceptionCaught = false;
|
||||
|
||||
// Clean up the stale messages in the write buffer.
|
||||
synchronized (channel.writeLock) {
|
||||
@ -694,8 +695,7 @@ class NioDatagramWorker implements Runnable {
|
||||
cause = new ClosedChannelException();
|
||||
}
|
||||
evt.getFuture().setFailure(cause);
|
||||
|
||||
fireExceptionCaught(channel, cause);
|
||||
fireExceptionCaught = true;
|
||||
}
|
||||
|
||||
Queue<MessageEvent> writeBuffer = channel.writeBufferQueue;
|
||||
@ -716,10 +716,14 @@ class NioDatagramWorker implements Runnable {
|
||||
break;
|
||||
}
|
||||
evt.getFuture().setFailure(cause);
|
||||
fireExceptionCaught(channel, cause);
|
||||
fireExceptionCaught = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fireExceptionCaught) {
|
||||
fireExceptionCaught(channel, cause);
|
||||
}
|
||||
}
|
||||
|
||||
static void setInterestOps(final NioDatagramChannel channel,
|
||||
|
@ -593,6 +593,7 @@ class NioWorker implements Runnable {
|
||||
|
||||
private static void cleanUpWriteBuffer(NioSocketChannel channel) {
|
||||
Exception cause = null;
|
||||
boolean fireExceptionCaught = false;
|
||||
|
||||
// Clean up the stale messages in the write buffer.
|
||||
synchronized (channel.writeLock) {
|
||||
@ -609,8 +610,7 @@ class NioWorker implements Runnable {
|
||||
cause = new ClosedChannelException();
|
||||
}
|
||||
evt.getFuture().setFailure(cause);
|
||||
|
||||
fireExceptionCaught(channel, cause);
|
||||
fireExceptionCaught = true;
|
||||
}
|
||||
|
||||
Queue<MessageEvent> writeBuffer = channel.writeBuffer;
|
||||
@ -631,10 +631,14 @@ class NioWorker implements Runnable {
|
||||
break;
|
||||
}
|
||||
evt.getFuture().setFailure(cause);
|
||||
fireExceptionCaught(channel, cause);
|
||||
fireExceptionCaught = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fireExceptionCaught) {
|
||||
fireExceptionCaught(channel, cause);
|
||||
}
|
||||
}
|
||||
|
||||
static void setInterestOps(
|
||||
|
Loading…
x
Reference in New Issue
Block a user