Repository: drill Updated Branches: refs/heads/master a7e298760 -> be43a9edd
DRILL-5589: JDBC client crashes after successful authentication if trace logging is enabled closes #854 Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/01bcb787 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/01bcb787 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/01bcb787 Branch: refs/heads/master Commit: 01bcb787493b218f80a8e66305d2e272ee004e1d Parents: a7e2987 Author: Sorabh Hamirwasia <shamirwa...@maprtech.com> Authored: Thu Jun 15 11:00:21 2017 -0700 Committer: Arina Ielchiieva <arina.yelchiy...@gmail.com> Committed: Mon Jun 19 12:18:42 2017 +0300 ---------------------------------------------------------------------- .../drill/exec/rpc/security/AuthenticationOutcomeListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/01bcb787/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/AuthenticationOutcomeListener.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/AuthenticationOutcomeListener.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/AuthenticationOutcomeListener.java index 7f51142..5c34d01 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/AuthenticationOutcomeListener.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/AuthenticationOutcomeListener.java @@ -121,6 +121,8 @@ public class AuthenticationOutcomeListener<T extends EnumLite, C extends ClientC completionListener.failed(RpcException.mapException( new SaslException("Server sent a corrupt message."))); } else { + // SaslSuccessProcessor.process disposes saslClient so get mechanism here to use later in logging + final String mechanism = connection.getSaslClient().getMechanismName(); try { final SaslChallengeContext<C> context = new SaslChallengeContext<>(value, ugi, connection); final SaslMessage saslResponse = processor.process(context); @@ -134,12 +136,12 @@ public class AuthenticationOutcomeListener<T extends EnumLite, C extends ClientC completionListener.success(null, null); if (logger.isTraceEnabled()) { logger.trace("Successfully authenticated to server using {} mechanism and encryption context: {}", - connection.getSaslClient().getMechanismName(), connection.getEncryptionCtxtString()); + mechanism, connection.getEncryptionCtxtString()); } } } catch (final Exception e) { logger.error("Authentication with encryption context: {} using mechanism {} failed with {}", - connection.getEncryptionCtxtString(), connection.getSaslClient().getMechanismName(), e.getMessage()); + connection.getEncryptionCtxtString(), mechanism, e.getMessage()); completionListener.failed(RpcException.mapException(e)); } }