fapifta commented on a change in pull request #3579:
URL: https://github.com/apache/hadoop/pull/3579#discussion_r734626158



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
##########
@@ -909,6 +898,35 @@ public AuthMethod run()
         connectingThread.set(null);
       }
     }
+
+    private void setFallBackToSimpleAuth(AtomicBoolean fallbackToSimpleAuth)
+        throws IOException {
+      if (fallbackToSimpleAuth == null) {
+        LOG.trace("Connection {} skips setting fallbackToSimpleAuth as it is 
null.", remoteId);
+        return;
+      }
+      if (authMethod == null) {
+        // setupIOStreams() will set up authMethod first, then call this 
method again.
+        return;
+      }
+      LOG.trace(
+          "Setting fallbackToSimpleAuth. AuthMethod is {}. Fallback allowed by 
configuration: {}. "
+              + "Security is {}.",
+          authMethod, fallbackAllowed,
+          UserGroupInformation.isSecurityEnabled() ? "enabled" : "disabled");
+      if (authMethod != AuthMethod.SIMPLE) {
+        LOG.trace("Disabling fallbackToSimpleAuth target does not require 
SIMPLE authentication.");
+        fallbackToSimpleAuth.set(false);
+      } else if (UserGroupInformation.isSecurityEnabled()) {
+        if (!fallbackAllowed) {
+          throw new IOException("Server asks us to fall back to SIMPLE auth, 
but this client is "

Review comment:
       Yes, you are right, I am unsure how that has been changed... but I have 
added a commit to fix it, thank you for the review and spotting it!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to