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

Hive QA commented on HIVE-20740:
--------------------------------



Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12947891/HIVE-20740.12.patch

{color:green}SUCCESS:{color} +1 due to 3 test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 12 failed/errored test(s), 15312 tests 
executed
*Failed tests:*
{noformat}
TestDataSourceProviderFactory - did not produce a TEST-*.xml file (likely timed 
out) (batchId=231)
TestFMSketchSerialization - did not produce a TEST-*.xml file (likely timed 
out) (batchId=231)
TestHLLNoBias - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestHLLSerialization - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestHyperLogLog - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestHyperLogLogDense - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestHyperLogLogMerge - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestHyperLogLogSparse - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestObjectStore - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
TestPartitionProjectionEvaluator - did not produce a TEST-*.xml file (likely 
timed out) (batchId=231)
TestRetriesInRetryingHMSHandler - did not produce a TEST-*.xml file (likely 
timed out) (batchId=231)
TestSparseEncodeHash - did not produce a TEST-*.xml file (likely timed out) 
(batchId=231)
{noformat}

Test results: 
https://builds.apache.org/job/PreCommit-HIVE-Build/14896/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/14896/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-14896/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.YetusPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 12 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12947891 - PreCommit-HIVE-Build

> Remove global lock in ObjectStore.setConf method
> ------------------------------------------------
>
>                 Key: HIVE-20740
>                 URL: https://issues.apache.org/jira/browse/HIVE-20740
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Vihang Karajgaonkar
>            Assignee: Vihang Karajgaonkar
>            Priority: Major
>         Attachments: HIVE-20740.01.patch, HIVE-20740.02.patch, 
> HIVE-20740.04.patch, HIVE-20740.05.patch, HIVE-20740.06.patch, 
> HIVE-20740.08.patch, HIVE-20740.09.patch, HIVE-20740.10.patch, 
> HIVE-20740.11.patch, HIVE-20740.12.patch
>
>
> The ObjectStore#setConf method has a global lock which can block other 
> clients in concurrent workloads.
> {code}
> @Override
>   @SuppressWarnings("nls")
>   public void setConf(Configuration conf) {
>     // Although an instance of ObjectStore is accessed by one thread, there 
> may
>     // be many threads with ObjectStore instances. So the static variables
>     // pmf and prop need to be protected with locks.
>     pmfPropLock.lock();
>     try {
>       isInitialized = false;
>       this.conf = conf;
>       this.areTxnStatsSupported = MetastoreConf.getBoolVar(conf, 
> ConfVars.HIVE_TXN_STATS_ENABLED);
>       configureSSL(conf);
>       Properties propsFromConf = getDataSourceProps(conf);
>       boolean propsChanged = !propsFromConf.equals(prop);
>       if (propsChanged) {
>         if (pmf != null){
>           clearOutPmfClassLoaderCache(pmf);
>           if (!forTwoMetastoreTesting) {
>             // close the underlying connection pool to avoid leaks
>             pmf.close();
>           }
>         }
>         pmf = null;
>         prop = null;
>       }
>       assert(!isActiveTransaction());
>       shutdown();
>       // Always want to re-create pm as we don't know if it were created by 
> the
>       // most recent instance of the pmf
>       pm = null;
>       directSql = null;
>       expressionProxy = null;
>       openTrasactionCalls = 0;
>       currentTransaction = null;
>       transactionStatus = TXN_STATUS.NO_STATE;
>       initialize(propsFromConf);
>       String partitionValidationRegex =
>           MetastoreConf.getVar(this.conf, 
> ConfVars.PARTITION_NAME_WHITELIST_PATTERN);
>       if (partitionValidationRegex != null && 
> !partitionValidationRegex.isEmpty()) {
>         partitionValidationPattern = 
> Pattern.compile(partitionValidationRegex);
>       } else {
>         partitionValidationPattern = null;
>       }
>       // Note, if metrics have not been initialized this will return null, 
> which means we aren't
>       // using metrics.  Thus we should always check whether this is non-null 
> before using.
>       MetricRegistry registry = Metrics.getRegistry();
>       if (registry != null) {
>         directSqlErrors = 
> Metrics.getOrCreateCounter(MetricsConstants.DIRECTSQL_ERRORS);
>       }
>       this.batchSize = MetastoreConf.getIntVar(conf, 
> ConfVars.RAWSTORE_PARTITION_BATCH_SIZE);
>       if (!isInitialized) {
>         throw new RuntimeException(
>         "Unable to create persistence manager. Check dss.log for details");
>       } else {
>         LOG.debug("Initialized ObjectStore");
>       }
>     } finally {
>       pmfPropLock.unlock();
>     }
>   }
> {code}
> The {{pmfPropLock}} is a static object and it disallows any other new 
> connection to HMS which is trying to instantiate ObjectStore. We should 
> either remove the lock or reduce the scope of the lock so that it is held for 
> a very small amount of time.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to