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

Vikram Dixit K commented on HIVE-12797:
---------------------------------------

>From the documentation of synchronized list:

{code}
Returns a synchronized (thread-safe) list backed by the specified list. In 
order to guarantee serial access, it is critical that all access to the backing 
list is accomplished through the returned list.

It is imperative that the user manually synchronize on the returned list when 
iterating over it:

  List list = Collections.synchronizedList(new ArrayList());
      ...
  synchronized (list) {
      Iterator i = list.iterator(); // Must be in synchronized block
      while (i.hasNext())
          foo(i.next());
  }
 
Failure to follow this advice may result in non-deterministic behavior.
The returned list will be serializable if the specified list is serializable.
{code}

It looks like we need a synchronized block even when the list is called a 
synchronized list.

> Synchronization issues with tez/llap session pool in hs2
> --------------------------------------------------------
>
>                 Key: HIVE-12797
>                 URL: https://issues.apache.org/jira/browse/HIVE-12797
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 2.0.0
>            Reporter: Vikram Dixit K
>            Assignee: Vikram Dixit K
>         Attachments: HIVE-12797.1.patch
>
>
> The changes introduced as part of HIVE-12674 causes issues while shutting 
> down hs2 when session pools are used.
> {code}
> java.util.ConcurrentModificationException
>         at 
> java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966) 
> ~[?:1.8.0_45]
>         at java.util.LinkedList$ListItr.remove(LinkedList.java:921) 
> ~[?:1.8.0_45]
>         at 
> org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolManager.stop(TezSessionPoolManager.java:288)
>  ~[hive-exec-2.0.0.2.3.5.0-79.jar:2.0.0.2.3.5.0-79]
>         at 
> org.apache.hive.service.server.HiveServer2.stop(HiveServer2.java:479) 
> [hive-jdbc-2.0.0.2.3.5.0-79-standalone.jar:2.0.0.2.3.5.0-79]
>         at 
> org.apache.hive.service.server.HiveServer2$2.run(HiveServer2.java:183) 
> [hive-jdbc-2.0.0.2.3.5.0-79-standalone.jar:2.0.0.2.3.5.0-79]
> {code}



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

Reply via email to