CDO: DB Connection leaks caused by InterruptedExceptions [message #1824420] |
Wed, 15 April 2020 06:56 |
Linuxhippy Mising name Messages: 72 Registered: July 2009 |
Member |
|
|
We are using CDO in single-process mode inside an OSGI-Servlet.
Because we would like to use our own connection pool we set reader-/writerStoreCapacity to 0, which seems to work fine, however from time I observe InterruptedExceptions while deactivating the StoreAccessor leading to connection leaks.
Could it be, the following things happen:
- Query is submitted to thread pool
- Is cancelled for some reason
- By default allowInterruptRunningQueries=true, so cancelation of the query will cause interruption of the executing thead of the thread pool
- In case cancellation happens after try/catch, the thread will keep it's interrupted flag - which is checked by AbstractQueuedSynchronizer.acquireSharedInterruptibly, and it immediatly throws an InterruptedException again.
- the StoreAccessor lurks around forever.
If so, any ideas how this issue could be solved?
For now I try running with allowInterruptRunningQueries=false.
Thanks, Clemens
PS: Shouldn't be QueryContext running/cancelled be at least volatile? Same for Worker.WorkerThread.running.
java.lang.InterruptedException
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343)
at java.base/java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
at org.eclipse.net4j.util.lifecycle.Lifecycle.lock(Lifecycle.java:310)
at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:118)
at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:168)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:235)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:225)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:251)
at org.eclipse.emf.cdo.spi.server.StoreAccessorPool.disposeStoreAccessor(StoreAccessorPool.java:182)
at org.eclipse.emf.cdo.spi.server.StoreAccessorPool.addStoreAccessor(StoreAccessorPool.java:111)
at org.eclipse.emf.cdo.spi.server.Store.releaseAccessor(Store.java:453)
at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.release(StoreAccessorBase.java:128)
at org.eclipse.emf.cdo.server.StoreThreadLocal.release(StoreThreadLocal.java:156)
at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:341)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[Updated on: Wed, 15 April 2020 06:59] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02934 seconds