[
https://issues.apache.org/jira/browse/PHOENIX-5033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16693749#comment-16693749
]
Xu Cang commented on PHOENIX-5033:
----------------------------------
Quoting Thomas' comment here:
"Since we call lockInterruptibly() the thread will be disabled until it can
acquire the lock or will throw an InterrupedException which we wrap as a
SQLException . "
> connect() method in PhoenixDriver should catch exception properly
> -----------------------------------------------------------------
>
> Key: PHOENIX-5033
> URL: https://issues.apache.org/jira/browse/PHOENIX-5033
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.13.0
> Reporter: Xu Cang
> Priority: Minor
>
> See this error in production:
>
> Problem executing query. *Stack trace:
> java.lang.IllegalMonitorStateException: attempt to unlock read lock, not
> locked by current thread*
> at
> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:444)
> at
> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:428)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1341)
> at
> java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:881)
> at org.apache.phoenix.jdbc.PhoenixDriver.unlock(PhoenixDriver.java:346)
> at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:223)
> at
> phoenix.connection.ProtectedPhoenixConnectionFactory$PhoenixConnectionFactory.createPhoenixConnection(ProtectedPhoenixConnectionFactory.java:233)
> at
> phoenix.connection.ProtectedPhoenixConnectionFactory.create(ProtectedPhoenixConnectionFactory.java:95)
> at
> phoenix.util.PhoenixConnectionUtil.getConnection(PhoenixConnectionUtil.java:59)
> at
> phoenix.util.PhoenixConnectionUtil.getConnection(PhoenixConnectionUtil.java:48)
> at
> pliny.db.PhoenixConnectionProviderImpl$ConnectionType$1.getConnection(PhoenixConnectionProviderImpl.java:158)
> at
> pliny.db.PhoenixConnectionProviderImpl.getGenericConnection(PhoenixConnectionProviderImpl.java:67)
> at
> communities.util.db.phoenix.ManagedPhoenixConnection.createManagedGenericConnection(ManagedPhoenixConnection.java:73)
> at
> communities.util.db.phoenix.ManagedPhoenixConnection.getGenericConnectionForAsyncOperation(ManagedPhoenixConnection.java:51)
> at
> communities.util.db.phoenix.AbstractAsyncPhoenixRequest.call(AbstractAsyncPhoenixRequest.java:183)
> at
> core.chatter.feeds.read.FeedEntityReadByUserPhoenixQuery.call(FeedEntityReadByUserPhoenixQuery.java:66)
> at
> communities.util.db.phoenix.AbstractAsyncPhoenixRequest.call(AbstractAsyncPhoenixRequest.java:1)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
>
>
> Questionable code:
>
>
> # @Override
> # public Connection connect(String url, Properties info) throws SQLException
> {
> # if (!acceptsURL(url)) {
> # return null;
> # }
> # try {
> # lockInterruptibly(LockMode.READ);
> # checkClosed();
> # return createConnection(url, info);
> # } finally {
> # unlock(LockMode.READ);
> # }
> # }
> #
> #
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)