|
@@ -220,6 +220,11 @@ public abstract class Server {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /*Returns a handle to the rpcMetrics (required in tests)*/
|
|
|
|
+ public RpcMetrics getRpcMetrics() {
|
|
|
|
+ return rpcMetrics;
|
|
|
|
+ }
|
|
|
|
|
|
/** A call queued for handling. */
|
|
/** A call queued for handling. */
|
|
private static class Call {
|
|
private static class Call {
|
|
@@ -877,7 +882,13 @@ public abstract class Server {
|
|
if (LOG.isDebugEnabled())
|
|
if (LOG.isDebugEnabled())
|
|
LOG.debug("Have read input token of size " + saslToken.length
|
|
LOG.debug("Have read input token of size " + saslToken.length
|
|
+ " for processing by saslServer.evaluateResponse()");
|
|
+ " for processing by saslServer.evaluateResponse()");
|
|
- byte[] replyToken = saslServer.evaluateResponse(saslToken);
|
|
|
|
|
|
+ byte[] replyToken;
|
|
|
|
+ try {
|
|
|
|
+ replyToken = saslServer.evaluateResponse(saslToken);
|
|
|
|
+ } catch (SaslException se) {
|
|
|
|
+ rpcMetrics.authenticationFailures.inc();
|
|
|
|
+ throw se;
|
|
|
|
+ }
|
|
if (replyToken != null) {
|
|
if (replyToken != null) {
|
|
if (LOG.isDebugEnabled())
|
|
if (LOG.isDebugEnabled())
|
|
LOG.debug("Will send token of size " + replyToken.length
|
|
LOG.debug("Will send token of size " + replyToken.length
|
|
@@ -1078,6 +1089,7 @@ public abstract class Server {
|
|
|
|
|
|
private void processOneRpc(byte[] buf) throws IOException,
|
|
private void processOneRpc(byte[] buf) throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
|
|
+ rpcMetrics.authenticationSuccesses.inc();
|
|
if (headerRead) {
|
|
if (headerRead) {
|
|
processData(buf);
|
|
processData(buf);
|
|
} else {
|
|
} else {
|
|
@@ -1121,7 +1133,9 @@ public abstract class Server {
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("Successfully authorized " + header);
|
|
LOG.debug("Successfully authorized " + header);
|
|
}
|
|
}
|
|
|
|
+ rpcMetrics.authorizationSuccesses.inc();
|
|
} catch (AuthorizationException ae) {
|
|
} catch (AuthorizationException ae) {
|
|
|
|
+ rpcMetrics.authorizationFailures.inc();
|
|
authFailedCall.connection = this;
|
|
authFailedCall.connection = this;
|
|
setupResponse(authFailedResponse, authFailedCall, Status.FATAL, null,
|
|
setupResponse(authFailedResponse, authFailedCall, Status.FATAL, null,
|
|
ae.getClass().getName(), ae.getMessage());
|
|
ae.getClass().getName(), ae.getMessage());
|