kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: KAFKA-5014; NetworkClient.leastLoadedNode should check if channel is ready
Date Thu, 20 Apr 2017 21:09:37 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 779874fb1 -> 2aa339de1


KAFKA-5014; NetworkClient.leastLoadedNode should check if channel is ready

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2813 from ijuma/kafka-5014-least-loaded-node-should-check-if-channel-is-ready


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

Branch: refs/heads/trunk
Commit: 2aa339de1135e110bba9c345e809bebf27ce3178
Parents: 779874f
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Thu Apr 20 14:07:58 2017 -0700
Committer: Jason Gustafson <jason@confluent.io>
Committed: Thu Apr 20 14:07:58 2017 -0700

----------------------------------------------------------------------
 clients/src/main/java/org/apache/kafka/clients/NetworkClient.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/2aa339de/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java b/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
index a279fe4..7bd0311 100644
--- a/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
+++ b/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
@@ -445,7 +445,7 @@ public class NetworkClient implements KafkaClient {
             int idx = (offset + i) % nodes.size();
             Node node = nodes.get(idx);
             int currInflight = this.inFlightRequests.count(node.idString());
-            if (currInflight == 0 && this.connectionStates.isReady(node.idString()))
{
+            if (currInflight == 0 && isReady(node, now)) {
                 // if we find an established connection with no in-flight requests we can
stop right away
                 log.trace("Found least loaded node {} connected with no in-flight requests",
node);
                 return node;


Mime
View raw message