You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Heng Chen (JIRA)" <ji...@apache.org> on 2016/07/07 03:37:11 UTC

[jira] [Commented] (HBASE-16190) IntegrationTestDDLMasterFailover failed with IllegalArgumentException: n must be positive

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

Heng Chen commented on HBASE-16190:
-----------------------------------

check the code on master.  There is one race condition for below code
{code}
private abstract class TableAction extends  MasterAction{
    protected HTableDescriptor selectTable(ConcurrentHashMap<TableName, HTableDescriptor> tableMap)
    {
      if (tableMap.isEmpty()){
        return null;
      }
      synchronized (tableMap){   //Notice:  the tableMap maybe cleared by other threads
        ArrayList<TableName> tableList = new ArrayList<TableName>(tableMap.keySet());
        TableName randomKey = tableList.get(RandomUtils.nextInt(tableList.size()));
        HTableDescriptor randomHtd = tableMap.get(randomKey);
        tableMap.remove(randomKey);
        return randomHtd;
      }
    }
  }
{code}

So i think we should do double check tableMap in sync scope.

> IntegrationTestDDLMasterFailover failed with IllegalArgumentException: n must be positive
> -----------------------------------------------------------------------------------------
>
>                 Key: HBASE-16190
>                 URL: https://issues.apache.org/jira/browse/HBASE-16190
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Romil Choksi
>            Priority: Minor
>              Labels: integration-test
>
> IntegrationTestDDLMasterFailover failed with IllegalArgumentException: n must be positive
> {code}
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|2016-07-05 12:19:21,661 INFO  [main] hbase.IntegrationTestDDLMasterFailover: Runtime is up
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|2016-07-05 12:19:22,026 ERROR [main] hbase.IntegrationTestDDLMasterFailover: Found exception in thread: Thread-11
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|2016-07-05 12:19:21,384 INFO  [Thread-16] hbase.IntegrationTestDDLMasterFailover: Performing Action: CREATE_TABLE
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|2016-07-05 12:19:22,027 INFO  [Thread-16] hbase.IntegrationTestDDLMasterFailover: Thread-16 stopped
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|2016-07-05 12:19:20,506 INFO  [Thread-30] hbase.IntegrationTestDDLMasterFailover: Performing Action: ADD_COLUMNFAMILY
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|java.lang.IllegalArgumentException: n must be positive
> 2016-07-05 12:19:22,154|beaver.machine|INFO|4569|140080276555584|MainThread|at java.util.Random.nextInt(Random.java:300)
> 2016-07-05 12:19:22,155|beaver.machine|INFO|4569|140080276555584|MainThread|at org.apache.commons.lang.math.JVMRandom.nextInt(JVMRandom.java:118)
> 2016-07-05 12:19:22,155|beaver.machine|INFO|4569|140080276555584|MainThread|at org.apache.commons.lang.math.RandomUtils.nextInt(RandomUtils.java:88)
> 2016-07-05 12:19:22,155|beaver.machine|INFO|4569|140080276555584|MainThread|at org.apache.commons.lang.math.RandomUtils.nextInt(RandomUtils.java:74)
> 2016-07-05 12:19:22,155|beaver.machine|INFO|4569|140080276555584|MainThread|at org.apache.hadoop.hbase.IntegrationTestDDLMasterFailover$TableAction.selectTable(IntegrationTestDDLMasterFailover.java:212)
> 2016-07-05 12:19:22,155|beaver.machine|INFO|4569|140080276555584|MainThread|at org.apache.hadoop.hbase.IntegrationTestDDLMasterFailover$AddColumnFamilyAction.perform(IntegrationTestDDLMasterFailover.java:421)
> 2016-07-05 12:19:22,155|beaver.machine|INFO|4569|140080276555584|MainThread|at org.apache.hadoop.hbase.IntegrationTestDDLMasterFailover$Worker.run(IntegrationTestDDLMasterFailover.java:695)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)