You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Viraj Jasani (Jira)" <ji...@apache.org> on 2023/05/08 17:57:00 UTC

[jira] [Created] (PHOENIX-6950) PhoenixDriver APIs should unlock closeLock only if thread is able to take lock

Viraj Jasani created PHOENIX-6950:
-------------------------------------

             Summary: PhoenixDriver APIs should unlock closeLock only if thread is able to take lock
                 Key: PHOENIX-6950
                 URL: https://issues.apache.org/jira/browse/PHOENIX-6950
             Project: Phoenix
          Issue Type: Bug
            Reporter: Viraj Jasani
            Assignee: Viraj Jasani


The bug surfaces rarely. We take read lock on closeLock as part of PhoenixDriver connect, getQueryServices, getConnectionQueryServices APIs. However, taking the locks is part of try block and we always try to perform the unlock on closeLock as part of finally block.

If the lock could not be acquired because the current thread was interrupted, we should not be allowed to unlock it. We can resolve this by:
 # Allow taking read lock outside of try and deal with InterruptedException by throwing SQLException
 # Use additional arg in PhoenixDriver#lockInterruptibly to ensure whether the lock could not be obtained by the current thread and use the info while unlocking



--
This message was sent by Atlassian Jira
(v8.20.10#820010)