kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkr...@apache.org
Subject git commit: KAFKA-1316 Follow-up patch for concurrent modification exception.
Date Thu, 19 Jun 2014 20:53:09 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk dd048d8fe -> d0c019a07


KAFKA-1316 Follow-up patch for concurrent modification exception.


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d0c019a0
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d0c019a0
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d0c019a0

Branch: refs/heads/trunk
Commit: d0c019a07ee63a8c31de2d60513ed8f03494e348
Parents: dd048d8
Author: Jay Kreps <jay.kreps@gmail.com>
Authored: Wed Jun 18 15:41:56 2014 -0700
Committer: Jay Kreps <jay.kreps@gmail.com>
Committed: Thu Jun 19 13:52:56 2014 -0700

----------------------------------------------------------------------
 .../org/apache/kafka/clients/producer/internals/Sender.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/d0c019a0/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
b/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
index c67b947..6fb5b82 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
@@ -14,6 +14,7 @@ package org.apache.kafka.clients.producer.internals;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -146,9 +147,11 @@ public class Sender implements Runnable {
         Set<Node> ready = this.accumulator.ready(cluster, now);
 
         // remove any nodes we aren't ready to send to
-        for (Node node : ready) {
+        Iterator<Node> iter = ready.iterator();
+        while (iter.hasNext()) {
+            Node node = iter.next();
             if (!this.client.ready(node, now))
-                ready.remove(node);
+                iter.remove();
         }
 
         // create produce requests


Mime
View raw message