[ 
https://issues.apache.org/jira/browse/HADOOP-13817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15870464#comment-15870464
 ] 

ASF GitHub Bot commented on HADOOP-13817:
-----------------------------------------

Github user jojochuang commented on a diff in the pull request:

    https://github.com/apache/hadoop/pull/161#discussion_r101592163
  
    --- Diff: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestShellBasedUnixGroupsMapping.java
 ---
    @@ -22,19 +22,32 @@
     
     import org.apache.commons.logging.Log;
     import org.apache.commons.logging.LogFactory;
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.hadoop.fs.CommonConfigurationKeys;
    +import org.apache.hadoop.test.GenericTestUtils;
    +import org.apache.hadoop.util.ReflectionUtils;
    +import org.apache.hadoop.util.Shell;
     import org.apache.hadoop.util.Shell.ExitCodeException;
     import org.apache.hadoop.util.Shell.ShellCommandExecutor;
     import org.junit.Test;
    +
     import static org.junit.Assert.*;
     import static org.mockito.Mockito.doNothing;
     import static org.mockito.Mockito.doThrow;
     import static org.mockito.Mockito.mock;
     import static org.mockito.Mockito.when;
     
     public class TestShellBasedUnixGroupsMapping {
    -  private static final Log LOG =
    +  private static final Log TESTLOG =
           LogFactory.getLog(TestShellBasedUnixGroupsMapping.class);
     
    +  private final GenericTestUtils.LogCapturer shellMappingLog =
    +      GenericTestUtils.LogCapturer.captureLogs(
    +          ShellBasedUnixGroupsMapping.LOG);
    +
    +  private static final boolean WINDOWS =
    +      (Shell.osType == Shell.OSType.OS_TYPE_WIN);
    --- End diff --
    
    I think you can just use Shell.WINDOWS instead.


> Add a finite shell command timeout to ShellBasedUnixGroupsMapping
> -----------------------------------------------------------------
>
>                 Key: HADOOP-13817
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13817
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security
>    Affects Versions: 2.6.0
>            Reporter: Harsh J
>            Assignee: Harsh J
>            Priority: Minor
>
> The ShellBasedUnixGroupsMapping run various {{id}} commands via the 
> ShellCommandExecutor modules without a timeout set (its set to 0, which 
> implies infinite).
> If this command hangs for a long time on the OS end due to an unresponsive 
> groups backend or other reasons, it also blocks the handlers that use it on 
> the NameNode (or other services that use this class). That inadvertently 
> causes odd timeout troubles on the client end where its forced to retry (only 
> to likely run into such hangs again with every attempt until at least one 
> command returns).
> It would be helpful to have a finite command timeout after which we may give 
> up on the command and return the result equivalent of no groups found.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to