Skip to main content



      Home
Home » Modeling » EMF » [CDO] Possibly deadlock during the session invalidation
[CDO] Possibly deadlock during the session invalidation [message #1821658] Tue, 18 February 2020 05:00 Go to next message
Eclipse UserFriend
Hi,

In our application, we sometimes encounter deadlocks if we commit while the session is invalidated. Indeed:
- During the commit, the transaction is locked and waits for the SessionInvalidator in session.startLocalCommit()
- During the session invalidation, the SessionInvalidator is locked and waits for the transaction in the updatePermissions method when comparing it with the head view.

The deadlock can be avoided by adding the following code in the doAfterActivate method in CDOSessionImpl, as done in CDOViewImpl :
ExecutorService executorService = getExecutorService();
invalidator.setDelegate(executorService);

It allows to not keep the lock on the SessionInvalidator, but is it the best solution?

Vincent
Re: [CDO] Possibly deadlock during the session invalidation [message #1821678 is a reply to message #1821658] Tue, 18 February 2020 09:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi Vincent,

Please submit a bugzilla with this information and I'll investigate quickly.

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMF&component=cdo.core

Cheers
/eike
Re: [CDO] Possibly deadlock during the session invalidation [message #1821717 is a reply to message #1821678] Wed, 19 February 2020 01:17 Go to previous messageGo to next message
Eclipse UserFriend
It's fixed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=560280
Re: [CDO] Possibly deadlock during the session invalidation [message #1821881 is a reply to message #1821717] Fri, 21 February 2020 10:22 Go to previous messageGo to next message
Eclipse UserFriend
I tried the recent build:
https://download.eclipse.org/modeling/emf/cdo/drops/I20200221-0544/
But we still see a deadlock in our own application tests.
(Disclaimer: we are not totally sure if we are using the transactions correctly in a multithreaded environment).

This is what we see:
"pool-1-thread-1" Id=92 BLOCKED on org.eclipse.emf.internal.cdo.session.CDOSessionImpl$SessionInvalidator@771b23 owned by "Thread-26" Id=164
	 org.eclipse.emf.internal.cdo.session.CDOSessionImpl$SessionInvalidator.reorderInvalidations(CDOSessionImpl.java:2001)
	 org.eclipse.emf.internal.cdo.session.CDOSessionImpl.invalidate(CDOSessionImpl.java:1193)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.postCommit(CDOTransactionImpl.java:4800)
	 org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:66)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1670)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1623)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1589)
	 <<<<<<my code calls transaction.commit here>>>>>>>>>>
	 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	 java.lang.Thread.run(Thread.java:748)
"Thread-26" Id=164 BLOCKED on org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl@283ab206 owned by "pool-1-thread-1" Id=92
	 org.eclipse.emf.internal.cdo.view.AbstractCDOView.getBranch(AbstractCDOView.java:926)
	 org.eclipse.emf.spi.cdo.AbstractChangeSetsConflictResolver$RemoteInvalidationEventQueue.handleEvent(AbstractChangeSetsConflictResolver.java:273)
	 org.eclipse.emf.spi.cdo.CDOSessionInvalidationEventQueue$1.notifyEvent(CDOSessionInvalidationEventQueue.java:48)
	 org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:172)
	 org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:118)
	 org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:93)
	 org.eclipse.net4j.util.container.Container.fireEvent(Container.java:63)
	 org.eclipse.emf.internal.cdo.session.CDOSessionImpl$SessionInvalidation.doRun(CDOSessionImpl.java:2120)
	 org.eclipse.net4j.util.concurrent.RunnableWithName.run(RunnableWithName.java:29)
	 org.eclipse.net4j.util.concurrent.SerializingExecutor.run(SerializingExecutor.java:82)
	 org.eclipse.net4j.util.concurrent.SynchronousExecutor.execute(SynchronousExecutor.java:32)
	 org.eclipse.net4j.util.concurrent.SerializingExecutor.schedule(SerializingExecutor.java:131)
	 org.eclipse.net4j.util.concurrent.SerializingExecutor.execute(SerializingExecutor.java:61)
	 org.eclipse.emf.internal.cdo.session.CDOSessionImpl$SessionInvalidator.scheduleInvalidations(CDOSessionImpl.java:2020)
	 org.eclipse.emf.internal.cdo.session.CDOSessionImpl$SessionInvalidator.reorderInvalidations(CDOSessionImpl.java:2012)
	 org.eclipse.emf.internal.cdo.session.CDOSessionImpl.invalidate(CDOSessionImpl.java:1193)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.postCommit(CDOTransactionImpl.java:4800)
	 org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:66)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1670)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1623)
	 org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1589)
	 <<<<<<my code calls transaction.commit here>>>>>>>>>>
	 java.lang.Thread.run(Thread.java:748)

Re: [CDO] Possibly deadlock during the session invalidation [message #1821903 is a reply to message #1821881] Sat, 22 February 2020 04:30 Go to previous message
Eclipse UserFriend
Hi Robert, let's continue the discussion on https://bugs.eclipse.org/bugs/show_bug.cgi?id=560280 ...
Previous Topic:Thanks for Jet Editor
Next Topic:[xcore] Using rootExtendsInterface
Goto Forum:
  


Current Time: Tue Nov 04 03:19:01 EST 2025

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

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

Back to the top