Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/storm/pull/2241#discussion_r158675721
--- Diff: storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java
---
@@ -297,31 +333,38 @@ public void send(Iterator<TaskMessage> msgs) {
dropMessages(msgs);
return;
}
-
- synchronized (writeLock) {
+ try {
while (msgs.hasNext()) {
TaskMessage message = msgs.next();
- MessageBatch full = batcher.add(message);
- if(full != null){
- flushMessages(channel, full);
+ MessageBatch batch = batcher.add(message);
+ if (batch != null) {
+ writeMessage(channel, batch);
}
}
+ MessageBatch batch = batcher.drain();
+ if (batch != null) {
+ writeMessage(channel, batch);
+ }
+ } catch (IOException e) {
+ dropMessages(msgs);
--- End diff --
Is `!channel.isConnected()` the only case for IOException? If then it
doesn't swallow the exception quietly, but it will swallow the exception
quietly if there're other cases for IOException.
---