You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2015/09/05 03:59:22 UTC
[1/4] storm git commit: Netty Fix.
Repository: storm
Updated Branches:
refs/heads/master ff9142dd0 -> 260830e33
Netty Fix.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/11886c0c
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/11886c0c
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/11886c0c
Branch: refs/heads/master
Commit: 11886c0c4c3aa2547b1ef571712bed83229dc4e4
Parents: 4368781
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Tue Sep 1 12:13:05 2015 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Tue Sep 1 12:13:05 2015 -0500
----------------------------------------------------------------------
.../backtype/storm/messaging/netty/Client.java | 37 ++++++++++++--------
1 file changed, 22 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/11886c0c/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
index 5b130fa..8300b1a 100644
--- a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
+++ b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
@@ -122,6 +122,8 @@ public class Client extends ConnectionWithStatus implements IStatefulObject {
private final MessageBuffer batcher;
+ private final Object writeLock = new Object();
+
@SuppressWarnings("rawtypes")
Client(Map stormConf, ChannelFactory factory, HashedWheelTimer scheduler, String host, int port, Context context) {
this.stormConf = stormConf;
@@ -245,21 +247,24 @@ public class Client extends ConnectionWithStatus implements IStatefulObject {
return;
}
-
- while (msgs.hasNext()) {
- TaskMessage message = msgs.next();
- MessageBatch full = batcher.add(message);
- if(full != null){
- flushMessages(channel, full);
+ synchronized (writeLock) {
+ while (msgs.hasNext()) {
+ TaskMessage message = msgs.next();
+ MessageBatch full = batcher.add(message);
+ if(full != null){
+ flushMessages(channel, full);
+ }
}
}
-
+
if(channel.isWritable()){
- // Netty's internal buffer is not full and we still have message left in the buffer.
- // We should write the unfilled MessageBatch immediately to reduce latency
- MessageBatch batch = batcher.drain();
- if(batch != null) {
- flushMessages(channel, batch);
+ synchronized (writeLock) {
+ // Netty's internal buffer is not full and we still have message left in the buffer.
+ // We should write the unfilled MessageBatch immediately to reduce latency
+ MessageBatch batch = batcher.drain();
+ if(batch != null) {
+ flushMessages(channel, batch);
+ }
}
} else {
// Channel's buffer is full, meaning that we have time to wait other messages to arrive, and create a bigger
@@ -444,9 +449,11 @@ public class Client extends ConnectionWithStatus implements IStatefulObject {
*/
public void notifyInterestChanged(Channel channel) {
if(channel.isWritable()){
- // Channel is writable again, write if there are any messages pending
- MessageBatch pending = batcher.drain();
- flushMessages(channel, pending);
+ synchronized (writeLock) {
+ // Channel is writable again, write if there are any messages pending
+ MessageBatch pending = batcher.drain();
+ flushMessages(channel, pending);
+ }
}
}
[3/4] storm git commit: Merge branch 'STORM-996' of
https://github.com/knusbaum/incubator-storm into STORM-996
Posted by ka...@apache.org.
Merge branch 'STORM-996' of https://github.com/knusbaum/incubator-storm into STORM-996
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/7b4e3733
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/7b4e3733
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/7b4e3733
Branch: refs/heads/master
Commit: 7b4e3733bdd47466b4198271e6bf03369531a886
Parents: ff9142d 3783f4e
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Sat Sep 5 10:40:39 2015 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sat Sep 5 10:40:39 2015 +0900
----------------------------------------------------------------------
.../backtype/storm/messaging/netty/Client.java | 37 ++++++++++++--------
1 file changed, 22 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
[4/4] storm git commit: add STORM-996 to CHANGELOG.md (0.10.0-beta2)
Posted by ka...@apache.org.
add STORM-996 to CHANGELOG.md (0.10.0-beta2)
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/260830e3
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/260830e3
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/260830e3
Branch: refs/heads/master
Commit: 260830e33d83b065365fef6fdcc41dacd2a45f41
Parents: 7b4e373
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Sat Sep 5 10:48:33 2015 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sat Sep 5 10:48:33 2015 +0900
----------------------------------------------------------------------
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/260830e3/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 76dfb7f..15f7036 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -49,6 +49,7 @@
* STORM-949: On the topology summary UI page, last shown error should have the time and date
## 0.10.0-beta2
+ * STORM-996: netty-unit-tests/test-batch demonstrates out-of-order delivery
* STORM-944: storm-hive pom.xml has a dependency conflict with calcite
* STORM-994: Connection leak between nimbus and supervisors
* STORM-1001: Undefined STORM_EXT_CLASSPATH adds '::' to classpath of workers
[2/4] storm git commit: Whitespace
Posted by ka...@apache.org.
Whitespace
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/3783f4e6
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/3783f4e6
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/3783f4e6
Branch: refs/heads/master
Commit: 3783f4e6669d185d5a0fd42468347238350c2774
Parents: 11886c0
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Tue Sep 1 12:37:01 2015 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Tue Sep 1 12:37:01 2015 -0500
----------------------------------------------------------------------
storm-core/src/jvm/backtype/storm/messaging/netty/Client.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/3783f4e6/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
index 8300b1a..08f5d2a 100644
--- a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
+++ b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
@@ -123,7 +123,7 @@ public class Client extends ConnectionWithStatus implements IStatefulObject {
private final MessageBuffer batcher;
private final Object writeLock = new Object();
-
+
@SuppressWarnings("rawtypes")
Client(Map stormConf, ChannelFactory factory, HashedWheelTimer scheduler, String host, int port, Context context) {
this.stormConf = stormConf;
@@ -256,7 +256,7 @@ public class Client extends ConnectionWithStatus implements IStatefulObject {
}
}
}
-
+
if(channel.isWritable()){
synchronized (writeLock) {
// Netty's internal buffer is not full and we still have message left in the buffer.
@@ -320,7 +320,7 @@ public class Client extends ConnectionWithStatus implements IStatefulObject {
if(batch.isEmpty()){
return;
}
-
+
final int numMessages = batch.size();
LOG.debug("writing {} messages to channel {}", batch.size(), channel.toString());
pendingMessages.addAndGet(numMessages);