[
https://issues.apache.org/jira/browse/HIVE-16172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15904623#comment-15904623
]
Tao Li commented on HIVE-16172:
-------------------------------
I have verified the change by cancelling the SQL query while it's executed.
Without the change, the query was not able to be cancelled (see details in the
JIRA description). With the change the cancellation worked. Note that we need
to set fairness to true when creating the lock, otherwise the effect is similar
to the original synchronized block.
[~daijy] Can you please review this change?
> Switch to a fairness lock to synchronize HS2 thrift client
> ----------------------------------------------------------
>
> Key: HIVE-16172
> URL: https://issues.apache.org/jira/browse/HIVE-16172
> Project: Hive
> Issue Type: Bug
> Reporter: Tao Li
> Assignee: Tao Li
> Attachments: HIVE-16172.1.patch
>
>
> A synchronized block is used in
> "org.apache.hive.jdbc.HiveConnection.SynchronizedHandler.invoke(Object,
> Method, Object[])" to synchronize the client invocations. The problem is that
> it does not guarantee any fairness. One issue we were seeing is that a
> cancellation request was not able to be issued to HS2 until all the
> getOperationStatus() calls are finished from a while loop. Thus the
> cancellation cannot take effect.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)