You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jason Dere (JIRA)" <ji...@apache.org> on 2017/02/16 02:35:41 UTC

[jira] [Commented] (HIVE-15936) ConcurrentModificationException in ATSHook

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

Jason Dere commented on HIVE-15936:
-----------------------------------

I don't think the durations should be constructed at HookContext construction time - in Driver.execute() this happens at the start of query execution (and re-used for both pre-hook and post-hook). As a result there will be very few PerfLogger values at this time. I think a more appropriate place would be within the ATSHook, but before submitting the work to the ExecutorService.



> ConcurrentModificationException in ATSHook
> ------------------------------------------
>
>                 Key: HIVE-15936
>                 URL: https://issues.apache.org/jira/browse/HIVE-15936
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>         Attachments: HIVE-15936.1.patch
>
>
> See ATSHook error:
> {noformat}
> java.util.ConcurrentModificationException
> 	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) ~[?:1.8.0_112]
> 	at java.util.HashMap$EntryIterator.next(HashMap.java:1471) ~[?:1.8.0_112]
> 	at java.util.HashMap$EntryIterator.next(HashMap.java:1469) ~[?:1.8.0_112]
> 	at java.util.AbstractCollection.toArray(AbstractCollection.java:196) ~[?:1.8.0_112]
> 	at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:290) ~[guava-14.0.1.jar:?]
> 	at org.apache.hadoop.hive.ql.log.PerfLogger.getEndTimes(PerfLogger.java:219) ~[hive-common-2.1.0.2.6.0.0-457.jar:2.1.0.2.6.0.0-457]
> 	at org.apache.hadoop.hive.ql.hooks.ATSHook.createPostHookEvent(ATSHook.java:347) ~[hive-exec-2.1.0.2.6.0.0-457.jar:2.1.0.2.6.0.0-457]
> 	at org.apache.hadoop.hive.ql.hooks.ATSHook$2.run(ATSHook.java:206) [hive-exec-2.1.0.2.6.0.0-457.jar:2.1.0.2.6.0.0-457]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_112]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_112]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112]
> 	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
> {noformat}
> According to [~jdere], ATSHook is currently accessing the PerfLogger on a separate thread, which means the main query thread can potentially write to the PerfLogger at the same time.
> The ATSHook should access the PerfLogger on the main query thread, before it sends the execution to the ATS Logger thread.



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