You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2017/03/20 00:03:39 UTC

[kudu-CR] WIP [java client] fixed NPE in master RPC error handler

Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/6401

to look at the new patch set (#2).

Change subject: WIP [java client] fixed NPE in master RPC error handler
......................................................................

WIP [java client] fixed NPE in master RPC error handler

Fixed an NPE in dispatchMasterErrorOrReturnException().  The
AsyncKuduClient.handleNotLeader() is used to handle both tablet-
and master server errors.  In the latter case, the KuduRpc.tablet member
is null, so accessing it results in NPE with exception stack like below:

java.lang.NullPointerException
  at org.apache.kudu.client.AsyncKuduClient.handleNotLeader(AsyncKuduClient.java:1269)
  at org.apache.kudu.client.TabletClient.dispatchMasterErrorOrReturnException(TabletClient.java:536)
  at org.apache.kudu.client.TabletClient.messageReceived(TabletClient.java:461)
  at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
  at org.apache.kudu.client.TabletClient.handleUpstream(TabletClient.java:595)
  at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
  ...

The error has been spotted while running the
org.apache.kudu.client.TestRowErrors test.

WIP:
  This NPE happens only if ConnectoToMaster RPC returns
  NOT_THE_LEADER error. From the other side, fixing this NPE does not
  resolve the situation: another NPE is thrown then:
java.lang.NullPointerException
  at org.apache.kudu.client.AsyncKuduClient.sendRpcToTablet(AsyncKuduClient.java:737)
  at org.apache.kudu.client.AsyncKuduClient$2RetryTimer.run(AsyncKuduClient.java:1302)
  at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:556)
  ...

  So, this requires additional clarification.

Change-Id: Ib923212db1e0931ed63b31a39f03335c701f91cc
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestMasterFailover.java
M src/kudu/master/master_service.cc
3 files changed, 27 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/01/6401/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6401
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib923212db1e0931ed63b31a39f03335c701f91cc
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <da...@apache.org>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>