risyomei commented on code in PR #41692:
URL: https://github.com/apache/spark/pull/41692#discussion_r1245969690


##########
core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:
##########
@@ -186,6 +186,8 @@ private[spark] class SparkSubmit extends Logging {
               } else {
                 throw e
               }
+          } finally {
+            FileSystem.closeAllForUGI(proxyUser)

Review Comment:
   Closing here because the UserGroupInformation#createProxyUser will create a 
new subject every time, and then any code executed in doAs section will be 
leaked if we don't close it properly.



##########
core/src/main/scala/org/apache/spark/deploy/security/HadoopDelegationTokenManager.scala:
##########
@@ -149,6 +150,9 @@ private[spark] class HadoopDelegationTokenManager(
           creds.addAll(newTokens)
         }
       })
+      if(!currentUser.equals(freshUGI)) {
+        FileSystem.closeAllForUGI(freshUGI)
+      }

Review Comment:
   Closing here because doLogin() may create new proxyuser sometime and may 
cause leaks



-- 
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