You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Eli Collins (JIRA)" <ji...@apache.org> on 2010/11/14 07:52:14 UTC

[jira] Created: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

getUserToGroupsMappingService is not thread safe
------------------------------------------------

                 Key: HADOOP-7033
                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
             Project: Hadoop Common
          Issue Type: Bug
          Components: security
    Affects Versions: 0.22.0
            Reporter: Eli Collins
             Fix For: 0.22.0


test-patch on trunk reports the following findbugs warning:

{noformat}
Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
Bug type LI_LAZY_INIT_STATIC (click for details) 
In class org.apache.hadoop.security.Groups
In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
On field org.apache.hadoop.security.Groups.GROUPS
At Groups.java:[lines 138-142]
{noformat}

The relevant code:

{noformat}
  public static Groups getUserToGroupsMappingService(Configuration conf) {
    if(GROUPS == null) {
      if(LOG.isDebugEnabled()) {
        LOG.debug(" Creating new Groups object");
      }
      GROUPS = new Groups(conf);
    }
    return GROUPS;
  }
{noformat}

This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Shvachko resolved HADOOP-7033.
-----------------------------------------

       Resolution: Duplicate
    Fix Version/s: 0.22.0

Closing as duplicate of HADOOP-7046.

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Po Cheung
>             Fix For: 0.22.0
>
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986206#action_12986206 ] 

Konstantin Shvachko commented on HADOOP-7033:
---------------------------------------------

I see
{code}
  public static synchronized Groups getUserToGroupsMappingService(
{code}
Both in trunk and in 0.22 after HADOOP-7046. Does it solve the underlying synchronization issue?

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Po Cheung
>             Fix For: 0.22.0
>
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Po Cheung (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Po Cheung reassigned HADOOP-7033:
---------------------------------

    Assignee: Po Cheung

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Po Cheung
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron T. Myers resolved HADOOP-7033.
------------------------------------

    Resolution: Duplicate

Ah yes, I see my confusion. This bug was indeed addressed, though not by HADOOP-7046, but rather by HADOOP-6864.

Re-resolving as a duplicate.

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Po Cheung
>             Fix For: 0.22.0
>
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron T. Myers reopened HADOOP-7033:
------------------------------------


Though HADOOP-7046 may address the findbugs warning, the underlying synchronization issue remains, and should be addressed. I think we should leave this open until it is.

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Po Cheung
>             Fix For: 0.22.0
>
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Po Cheung (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985952#action_12985952 ] 

Po Cheung commented on HADOOP-7033:
-----------------------------------

This FindBugs warning is already fixed in trunk and a patch is available for 0.22.  See HADOOP-7046.

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Po Cheung
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-7033) getUserToGroupsMappingService is not thread safe

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931866#action_12931866 ] 

Aaron T. Myers commented on HADOOP-7033:
----------------------------------------

Though obviously we should fix this, I don't think it can actually cause any problems at the moment, since {{getUserToGroupsMappingService}} is only called in one place (UserGroupInformation.java:243) and that method is {{synchronized}}.

> getUserToGroupsMappingService is not thread safe
> ------------------------------------------------
>
>                 Key: HADOOP-7033
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7033
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>             Fix For: 0.22.0
>
>
> test-patch on trunk reports the following findbugs warning:
> {noformat}
> Incorrect lazy initialization of static field org.apache.hadoop.security.Groups.GROUPS in org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> Bug type LI_LAZY_INIT_STATIC (click for details) 
> In class org.apache.hadoop.security.Groups
> In method org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Configuration)
> On field org.apache.hadoop.security.Groups.GROUPS
> At Groups.java:[lines 138-142]
> {noformat}
> The relevant code:
> {noformat}
>   public static Groups getUserToGroupsMappingService(Configuration conf) {
>     if(GROUPS == null) {
>       if(LOG.isDebugEnabled()) {
>         LOG.debug(" Creating new Groups object");
>       }
>       GROUPS = new Groups(conf);
>     }
>     return GROUPS;
>   }
> {noformat}
> This is problematic if getUserToGroupsMappingService can accessed simultaneously by multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.