kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject kudu git commit: java: Fix NPE when connection torn down
Date Mon, 06 Aug 2018 18:03:17 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 997ad765f -> 07c9962cb


java: Fix NPE when connection torn down

In cases where there is no message in a caught exception we would end up
with a NullPointerException in the Status constructor. Instead of
passing the message from the exception to Status, pass the
stringification of the exception instead, which will include the
exception type and the message, if present.

Found based on observing the following exception thrown from a Spark job
when the connection had timed out on read:

18/07/09 18:48:21 ERROR client.Connection: [peer master-mpercy-cdh60-1.vpc.cloudera.com:7051(mpercy-cdh60-1.vpc.cloudera.com:7051)]
unexpected exception from downstream on [id: 0x64defe6e, 0.0.0.0/0.0.0.0:51086]
java.lang.NullPointerException
        at org.apache.kudu.client.Status.<init>(Status.java:54)
        at org.apache.kudu.client.Status.<init>(Status.java:68)
        at org.apache.kudu.client.Status.NetworkError(Status.java:159)
        at org.apache.kudu.client.Connection.channelClosed(Connection.java:271)
        at org.apache.kudu.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:88)
        at org.apache.kudu.client.Connection.handleUpstream(Connection.java:243)

Change-Id: I0b2c9f75d5a25e40abc261404b99370483db17c3
Reviewed-on: http://gerrit.cloudera.org:8080/10916
Reviewed-by: Dan Burkert <danburkert@apache.org>
Reviewed-by: Grant Henke <granthenke@apache.org>
Tested-by: Mike Percy <mpercy@apache.org>


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

Branch: refs/heads/master
Commit: 07c9962cbf9660812a2cb6f984c98e29c735840e
Parents: 997ad76
Author: Mike Percy <mpercy@apache.org>
Authored: Mon Jul 9 19:10:59 2018 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Mon Aug 6 18:02:51 2018 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/kudu/client/Connection.java           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/07c9962c/java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java b/java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java
index 5d3155b..27c5d8f 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java
@@ -261,7 +261,7 @@ class Connection extends SimpleChannelUpstreamHandler {
     lock.lock();
     try {
       if (connectFuture != null && connectFuture.getCause() != null) {
-        msg = connectFuture.getCause().getMessage();
+        msg = connectFuture.getCause().toString();
       }
     } finally {
       lock.unlock();


Mime
View raw message