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) {
|
private static void cleanUpWriteBuffer(final NioDatagramChannel channel) {
|
||||||
Exception cause = null;
|
Exception cause = null;
|
||||||
|
boolean fireExceptionCaught = false;
|
||||||
|
|
||||||
// Clean up the stale messages in the write buffer.
|
// Clean up the stale messages in the write buffer.
|
||||||
synchronized (channel.writeLock) {
|
synchronized (channel.writeLock) {
|
||||||
@ -694,8 +695,7 @@ class NioDatagramWorker implements Runnable {
|
|||||||
cause = new ClosedChannelException();
|
cause = new ClosedChannelException();
|
||||||
}
|
}
|
||||||
evt.getFuture().setFailure(cause);
|
evt.getFuture().setFailure(cause);
|
||||||
|
fireExceptionCaught = true;
|
||||||
fireExceptionCaught(channel, cause);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Queue<MessageEvent> writeBuffer = channel.writeBufferQueue;
|
Queue<MessageEvent> writeBuffer = channel.writeBufferQueue;
|
||||||
@ -716,11 +716,15 @@ class NioDatagramWorker implements Runnable {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
evt.getFuture().setFailure(cause);
|
evt.getFuture().setFailure(cause);
|
||||||
|
fireExceptionCaught = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fireExceptionCaught) {
|
||||||
fireExceptionCaught(channel, cause);
|
fireExceptionCaught(channel, cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setInterestOps(final NioDatagramChannel channel,
|
static void setInterestOps(final NioDatagramChannel channel,
|
||||||
ChannelFuture future, int interestOps) {
|
ChannelFuture future, int interestOps) {
|
||||||
|
@ -593,6 +593,7 @@ class NioWorker implements Runnable {
|
|||||||
|
|
||||||
private static void cleanUpWriteBuffer(NioSocketChannel channel) {
|
private static void cleanUpWriteBuffer(NioSocketChannel channel) {
|
||||||
Exception cause = null;
|
Exception cause = null;
|
||||||
|
boolean fireExceptionCaught = false;
|
||||||
|
|
||||||
// Clean up the stale messages in the write buffer.
|
// Clean up the stale messages in the write buffer.
|
||||||
synchronized (channel.writeLock) {
|
synchronized (channel.writeLock) {
|
||||||
@ -609,8 +610,7 @@ class NioWorker implements Runnable {
|
|||||||
cause = new ClosedChannelException();
|
cause = new ClosedChannelException();
|
||||||
}
|
}
|
||||||
evt.getFuture().setFailure(cause);
|
evt.getFuture().setFailure(cause);
|
||||||
|
fireExceptionCaught = true;
|
||||||
fireExceptionCaught(channel, cause);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Queue<MessageEvent> writeBuffer = channel.writeBuffer;
|
Queue<MessageEvent> writeBuffer = channel.writeBuffer;
|
||||||
@ -631,11 +631,15 @@ class NioWorker implements Runnable {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
evt.getFuture().setFailure(cause);
|
evt.getFuture().setFailure(cause);
|
||||||
|
fireExceptionCaught = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fireExceptionCaught) {
|
||||||
fireExceptionCaught(channel, cause);
|
fireExceptionCaught(channel, cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setInterestOps(
|
static void setInterestOps(
|
||||||
NioSocketChannel channel, ChannelFuture future, int interestOps) {
|
NioSocketChannel channel, ChannelFuture future, int interestOps) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user