Github user parthchandra commented on a diff in the pull request:
https://github.com/apache/drill/pull/1079#discussion_r159487621
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserClient.java ---
@@ -344,7 +344,18 @@ private boolean
clientNeedsAuthExceptPlain(DrillProperties props) {
mechanismName = factory.getSimpleName();
logger.trace("Will try to authenticate to server using {} mechanism
with encryption context {}",
mechanismName, connection.getEncryptionCtxtString());
+
+ // Update the thread context class loader to current class loader
+ // See DRILL-6063 for detailed description
+ final ClassLoader oldThreadCtxtCL =
Thread.currentThread().getContextClassLoader();
+ final ClassLoader newThreadCtxtCL = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(newThreadCtxtCL);
+
--- End diff --
Is this the only place we need to update? For eaxmple, with SASL the
authentication mechanism plugin would have to be in the class path when the
authentication method is dtermined. But you have already restored the thread
context. (Or does the oldThreadContextCL have the SASL jars in the classpath?)
---