You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2016/07/07 18:33:34 UTC

[5/7] incubator-kudu git commit: [java-client] Fix a hang in TabletClient

[java-client] Fix a hang in TabletClient

TabletClient#sendRpc has been changing a lot lately, and it's finicky.
In this case we weren't handling RPCs that we needed to retry when the
connection had already been closed before we even tried to encode the
RPC. I've only been able to reproduce this on the cluster with really
slow inserts.

Change-Id: I5f92a2f9464f245182a59178f2eab8a88422864c
Reviewed-on: http://gerrit.cloudera.org:8080/3586
Reviewed-by: Dan Burkert <da...@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: b130c5ad47d0dd84b1deb3c7551a62468360bdb1
Parents: dd341b7
Author: Jean-Daniel Cryans <jd...@apache.org>
Authored: Wed Jul 6 20:55:27 2016 -0700
Committer: Jean-Daniel Cryans <jd...@apache.org>
Committed: Thu Jul 7 18:16:02 2016 +0000

----------------------------------------------------------------------
 .../kudu-client/src/main/java/org/kududb/client/TabletClient.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/b130c5ad/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java b/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
index 4d664a9..d3ecf8f 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
@@ -187,7 +187,8 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
         // cleanup() already took care of calling failOrRetryRpc() for us. If it did, the entry we
         // added in rpcs_inflight will be missing. If not, we have to call failOrRetryRpc()
         // ourselves after this synchronized block.
-        if (encodedRpcAndId != null && rpcs_inflight.containsKey(encodedRpcAndId.getSecond())) {
+        // `encodedRpcAndId` is null iff `chan` is null.
+        if (encodedRpcAndId == null || rpcs_inflight.containsKey(encodedRpcAndId.getSecond())) {
           failRpc = true;
         }
       } else {