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

Jason Dere commented on HIVE-5474:
----------------------------------

Digging around this one, looks like there may be an issue with the 
EmbeddedLockManager. The test is trying to run "DROP TABLE test_exec_thrift", 
and is attempting to acquire the following locks from the EmbeddedLockManager:

[SHARED, default/test_exec_thrift]
[SHARED, default]
[EXCLUSIVE, default/test_exec_thrift]
[SHARED, default]
[SHARED, default]

After EmbeddedLockManager.sortLocks(), the locks are sorted and acquired in 
this order:
[SHARED, default]
[SHARED, default]
[SHARED, default]
[EXCLUSIVE, default/test_exec_thrift]
[SHARED, default/test_exec_thrift]

The problem is that once the exclusive lock on test_exec_thrift is acquired, 
the EmbeddedLockManager is unable to get the shared lock on that table.
So I think the fix here is that the lock requests generated by 
Driver.acquireReadWriteLocks() should be de-duped, so that we fetch either a 
shared or exclusive lock, not both. Either that, or the lock managers need to 
be updated to allow multiple locks on the same object to succeed if it's from 
the same query. But I think the first solution would be more appropriate, and 
would be more in line with 
https://cwiki.apache.org/confluence/display/Hive/Locking.

> TestThriftHttpCLIService.testExecuteStatement fails in sequential run
> ---------------------------------------------------------------------
>
>                 Key: HIVE-5474
>                 URL: https://issues.apache.org/jira/browse/HIVE-5474
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>            Reporter: Thejas M Nair
>            Assignee: Vaibhav Gumashta
>
> This is seen in hive 0.12 branch sequential test run. 
> TestThriftHttpCLIService.testExecuteStatement
> https://builds.apache.org/job/Hive-branch-0.12-hadoop1/13/testReport/org.apache.hive.service.cli.thrift/TestThriftHttpCLIService/testExecuteStatement/
> stderr has "FAILED: Error in acquiring locks: Locks on the underlying
> objects cannot be acquired. retry after some time"



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to