yaooqinn commented on PR #39343:
URL: https://github.com/apache/spark/pull/39343#issuecomment-1372103080

   Since 2 different sessions from the same user have their own `sessionUgi`, 
does `FileSystem.closeAllForUGI` only close those instances belonging to the 
session?
   
   Did a quick test with spark-shell script as follows
   ```scala
   
     val ugi1 = UserGroupInformation.createRemoteUser("abc")
     val fs1 = ugi1.doAs(new PrivilegedExceptionAction[FileSystem]() {
       override def run: FileSystem = FileSystem.get(new Configuration)
     })
     val ugi2 = UserGroupInformation.createRemoteUser("abc")
     val fs2 = ugi2.doAs(new PrivilegedExceptionAction[FileSystem]() {
       override def run: FileSystem = FileSystem.get(new Configuration)
     })
     // as ugi1 != ugi2, only fs1 will be closed
     FileSystem.closeAllForUGI(ugi1)
   
     val fsNotClosed = ugi2.doAs(new PrivilegedExceptionAction[FileSystem]() {
       override def run: FileSystem = FileSystem.get(new Configuration)
     })
    
     require(fs2 == fsNotClosed)
   
     val fsRecreated = ugi1.doAs(new PrivilegedExceptionAction[FileSystem]() {
       override def run: FileSystem = FileSystem.get(new Configuration)
     })
     require(fs1 != fsRecreated)
   ```
   
   


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