Github user sryza commented on the pull request:

    https://github.com/apache/spark/pull/607#issuecomment-41952140
  
    I just tested this out with a toy program and observed that the child 
thread gets the same user and the same FIleSystem.
    
        final Configuration conf = new Configuration();
        final UserGroupInformation ugi = 
UserGroupInformation.createRemoteUser("arloguthrie");
    
        ugi.doAs(new PrivilegedAction<Integer>() {
          public Integer run() {
            FileSystem fs = null;
            try {
              System.out.println("current user in parent thread: " + 
UserGroupInformation.getCurrentUser());
              fs = FileSystem.get(conf);
            } catch (Exception ex) {
              ex.printStackTrace();
            }
            final FileSystem finalFs = fs;
            Thread child = new Thread() {
              public void run() {
                try {
                  System.out.println("current user in child thread: " + 
UserGroupInformation.getCurrentUser());
                  System.out.println("same fs in child: " + 
(FileSystem.get(conf) == finalFs));
                } catch (Exception ex) {
                  ex.printStackTrace();
                }
              }
            };
            child.start();
            return 0;
          }
        });



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to