diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java index 6440702430..1c909bf4d1 100644 --- a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java +++ b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java @@ -2063,7 +2063,8 @@ public void run(final Timeout timeout) { * Remove the tablet server from the RemoteTablet's locations. Right now nothing is removing * the tablet itself from the caches. */ - private void invalidateTabletCache(RemoteTablet tablet, ServerInfo info, + private void invalidateTabletCache(RemoteTablet tablet, + ServerInfo info, String errorMessage) { final String uuid = info.getUuid(); LOG.info("Invalidating location {} for tablet {}: {}", diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/RpcProxy.java b/java/kudu-client/src/main/java/org/apache/kudu/client/RpcProxy.java index 606cfd8ca2..7b2f254159 100644 --- a/java/kudu-client/src/main/java/org/apache/kudu/client/RpcProxy.java +++ b/java/kudu-client/src/main/java/org/apache/kudu/client/RpcProxy.java @@ -409,11 +409,21 @@ private static void failOrRetryRpc(AsyncKuduClient client, .build()); RemoteTablet tablet = rpc.getTablet(); - // Note As of the time of writing (03/11/16), a null tablet doesn't make sense, if we see a null - // tablet it's because we didn't set it properly before calling sendRpc(). + // Note: As of the time of writing (03/11/16), a null tablet doesn't make sense, if we see a + // null tablet it's because we didn't set it properly before calling sendRpc(). if (tablet == null) { // Can't retry, dunno where this RPC should go. rpc.errback(exception); + return; + } + if (exception instanceof InvalidAuthnTokenException) { + client.handleInvalidAuthnToken(rpc); + } else if (exception instanceof InvalidAuthzTokenException) { + client.handleInvalidAuthzToken(rpc, exception); + } else if (exception.getStatus().isServiceUnavailable()) { + client.handleRetryableError(rpc, exception); } else { + // If we don't really know anything about the exception, invalidate the location for the + // tablet, opening the possibility of retrying on a different server. client.handleTabletNotFound(rpc, exception, connection.getServerInfo()); } }