Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » CDO: DB Connection leaks caused by InterruptedExceptions
CDO: DB Connection leaks caused by InterruptedExceptions [message #1824420] Wed, 15 April 2020 06:56 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 59
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

Re: CDO: DB Connection leaks caused by InterruptedExceptions [message #1824440 is a reply to message #1824420] Wed, 15 April 2020 11:10 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6556
Registered: July 2009
Senior Member
Thanks for the detailed problem description. Please submit a bugzilla so that we can track the problem: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMF&component=cdo.core&version=4.10

Re: CDO: DB Connection leaks caused by InterruptedExceptions [message #1826164 is a reply to message #1824440] Mon, 20 April 2020 14:28 Go to previous messageGo to next message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 109
Registered: July 2015
Senior Member
I see a similar problem during application shutdown of a client:
java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1302)
	at java.util.concurrent.Semaphore.acquire(Semaphore.java:312)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.lock(Lifecycle.java:312)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:118)
	at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalDeactivate(ShareableLifecycle.java:52)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:170)
	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:252)
	at org.eclipse.emf.internal.cdo.bundle.Activator$Implementation.doStop(Activator.java:129)
	at org.eclipse.emf.internal.cdo.bundle.Activator$Implementation.stop(Activator.java:99)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:899)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(AccessController.java:734)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:891)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1029)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:370)
	at org.eclipse.osgi.container.Module.doStop(Module.java:658)
	at org.eclipse.osgi.container.Module.stop(Module.java:520)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1885)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1760)
	at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:202)
	at org.eclipse.osgi.container.Module.doStop(Module.java:658)
	at org.eclipse.osgi.container.Module.stop(Module.java:520)
	at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220)
	at java.lang.Thread.run(Thread.java:819)
Re: CDO: DB Connection leaks caused by InterruptedExceptions [message #1826648 is a reply to message #1826164] Tue, 28 April 2020 08:13 Go to previous message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 59
Registered: July 2009
Member
Bug reported: https://bugs.eclipse.org/bugs/show_bug.cgi?id=562241

Robert: running with allowInterruptRunningQueries=false solved the issue for us:
IRepository.Props.ALLOW_INTERRUPT_RUNNING_QUERIES = "false"
Previous Topic:ECore model evolution and versioning
Next Topic:issues while creating ecore from WSDL XSD
Goto Forum:
  


Current Time: Fri Apr 16 12:20:19 GMT 2021

Powered by FUDForum. Page generated in 0.02062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top