Ding Yuan created HIVE-6450:
-------------------------------

             Summary: Potential deadlock caused by unlock exceptions
                 Key: HIVE-6450
                 URL: https://issues.apache.org/jira/browse/HIVE-6450
             Project: Hive
          Issue Type: Bug
          Components: Locking
    Affects Versions: 0.12.0
            Reporter: Ding Yuan


In the following two code snippets, unlock might fail with LockException. This
exception is not handled and thus the program might go on without releasing the 
lock, causing potential deadlock or starvations.

Line: 197, File: "org/apache/hadoop/hive/ql/lockmgr/EmbeddedLockManager.java"
{noformat}
194:       try {
195:         unlock(locked, numRetriesForUnLock, sleepTime);
196:       } catch (LockException e) {
197:         LOG.info(e);
198:       }
{noformat}

Line: 276, File: 
"org/apache/hadoop/hive/ql/lockmgr/zookeeper/ZooKeeperHiveLockManager.java"
{noformat}
271:         try {
272:           LOG.info(" about to release lock for " + 
hiveLock.getHiveLockObject().getName());
273:           unlock(hiveLock);
274:         } catch (LockException e) {
275:           // The lock may have been released. Ignore and continue
276:           LOG.warn("Error when releasing lock", e);
277:         }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to