hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hive QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-20665) Hive Parallel Tasks - Hive Configuration ConcurrentModificationException
Date Tue, 02 Oct 2018 01:22:00 GMT

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

Hive QA commented on HIVE-20665:
--------------------------------



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

{color:red}ERROR:{color} -1 due to no test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 8 failed/errored test(s), 15007 tests executed
*Failed tests:*
{noformat}
org.apache.hadoop.hive.cli.TestHBaseCliDriver.testCliDriver[hbase_handler_bulk] (batchId=106)
org.apache.hadoop.hive.cli.TestMiniDruidCliDriver.testCliDriver[druid_timestamptz2] (batchId=193)
org.apache.hadoop.hive.cli.TestMiniDruidCliDriver.testCliDriver[druidmini_dynamic_partition]
(batchId=194)
org.apache.hadoop.hive.cli.TestMiniDruidCliDriver.testCliDriver[druidmini_mv] (batchId=193)
org.apache.hadoop.hive.cli.TestMiniDruidCliDriver.testCliDriver[druidmini_test_alter] (batchId=194)
org.apache.hadoop.hive.cli.TestMiniDruidCliDriver.testCliDriver[druidmini_test_insert] (batchId=194)
org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[load_dyn_part3] (batchId=160)
org.apache.hadoop.hive.cli.TestNegativeCliDriver.testCliDriver[druid_address] (batchId=98)
{noformat}

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

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: 8 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12941992 - PreCommit-HIVE-Build

> Hive Parallel Tasks - Hive Configuration ConcurrentModificationException
> ------------------------------------------------------------------------
>
>                 Key: HIVE-20665
>                 URL: https://issues.apache.org/jira/browse/HIVE-20665
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 2.3.2, 3.1.0, 4.0.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Major
>         Attachments: HIVE-20665.1.patch
>
>
> When parallel tasks are enabled in Hive, all of the resulting queries share the same
Hive configuration.  This is problematic as each query will modify the same {{HiveConf}} object
with things like query ID and query text.  This will overwrite each other and cause {{ConcurrentModificationException}}
issues.
> {code:java|title=SQLOperation.java}
>         public Object run() throws HiveSQLException {
>           Hive.set(parentHive, false);
>           // TODO: can this result in cross-thread reuse of session state?
>           SessionState.setCurrentSessionState(parentSessionState);
>           PerfLogger.setPerfLogger(SessionState.getPerfLogger());
>           LogUtils.registerLoggingContext(queryState.getConf());
>           try {
>             if (asyncPrepare) {
>               prepare(queryState);
>             }
>             runQuery();
>           } catch (HiveSQLException e) {
> // ...
> {code}
> [Code Here|https://github.com/apache/hive/blob/6e27a5315a44c55ef3b178e7212c9068de322d01/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java#L308-L319]
> From this code it can be seen that for every thread launched, it is all calling {{setCurrentSessionState}}.
> {code:java|title=SessionStates.java}
>   /**
>    * Sets the given session state in the thread local var for sessions.
>    */
>   public static void setCurrentSessionState(SessionState startSs) {
>     tss.get().attach(startSs);
>   }
>   // SessionState is not available in runtime and Hive.get().getConf() is not safe to
call
>   private static class SessionStates {
>     private SessionState state;
>     private HiveConf conf;
>     private void attach(SessionState state) {
>       this.state = state;
>       attach(state.getConf());
>     }
>     private void attach(HiveConf conf) {
>       // -- SHALLOW COPY HERE, ALL THREADS SHARING SAME REFERENCE -- //
>       this.conf = conf;
>       ClassLoader classLoader = conf.getClassLoader();
>       if (classLoader != null) {
>         Thread.currentThread().setContextClassLoader(classLoader);
>       }
>     }
>   }
> {code}
> [Code Here|https://github.com/apache/hive/blob/7795c0a7dc59941671f8845d78b16d9e5ddc9ea3/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java#L540-L556]
> Ensure that all threads get their own copy of the {{HiveConf}} object to use and modify.



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

Mime
View raw message