Skip to main content



      Home
Home » Modeling » EMF » [CDO] Rare problem in permission cache(NoPermissionException when modifying a writable object)
[CDO] Rare problem in permission cache [message #1849800] Thu, 03 February 2022 05:04 Go to next message
Eclipse UserFriend
This issue kept us busy for some time and we could never figure out where it is coming from. But now I can somewhat reproduce it on our system.

Problem description:
We continuously add objects to a list (which is the content of a cdo object). We keep the list in a reasonable size of ~1000 obejcts.
Quite rarely, but randomly (it takes ~0 to 1000k commits), one of the objects in the list will have the permission to be read-only. This is tied to the session. Even if we open a new transaction, the permission will stay read-only. For new sessions, the permission is correct again.


Now I am able to reproduce this on our system. I tested the 2021-09 release with H2 db and TCP/JVM/WS connection, non-branching, non-auditing. What I do:
* Add new objects to a list in one thread.
* In another thread: open a view and add an EContentAdapter to the object that holds the list and wait for 1 second. Then close the view again and repeat.

I attached my console output with full cdo tracing enabled. See end for the NoPermissionException. Maybe we can find a workaround to recover the correct permission? Or is this log even enough to hint to a fix?

[Updated on: Thu, 03 February 2022 05:25] by Moderator

Re: [CDO] Rare problem in permission cache [message #1849806 is a reply to message #1849800] Thu, 03 February 2022 06:18 Go to previous messageGo to next message
Eclipse UserFriend
I created another debug log with the most recent release (20220116-1034). This time additionally with net4j tracing enabled.

What I noticed: we seem to always get another exception beforehand "java.lang.UnsupportedOperationException: Mapping strategy does not support audits"
Re: [CDO] Rare problem in permission cache [message #1849807 is a reply to message #1849800] Thu, 03 February 2022 06:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Robert,

Thanks for trying to reproduce the problem.
Do you think you can come up with a CDO test case, so that I can reproduce it, too?

Here's a list of existing test cases that use and test a security manager:

Bugzilla_417483_Test.doSetUp()
Bugzilla_399487_Test.setUp()
Bugzilla_422170_Test.setUp()
Bugzilla_501607_Test.setUp()
Bugzilla_560280_Test.setUp()
Bugzilla_418267_Test.startSecureRepository()
Re: [CDO] Rare problem in permission cache [message #1849816 is a reply to message #1849807] Thu, 03 February 2022 09:48 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, I missed your second message. Do you have the CDO sources at hand in order to try something out?

In CommitTransactionIndication.java at line 410 you see this:

CDOBranchPoint securityContext = commitContext.getBranchPoint();


Please change that line to the following:

CDOBranchPoint securityContext = commitContext.getBranchPoint();
if (!session.getManager().getRepository().isSupportingAudits())
{
     securityContext = securityContext.getBranch().getHead();
}


Does that fix the problem?
Re: [CDO] Rare problem in permission cache [message #1849819 is a reply to message #1849807] Thu, 03 February 2022 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Eike, please see the attached patch which reproduces the problem for me quite reliably. You need to start the test case in non-audit mode.

Its a bit messy ("Logspec" package was copied from our code), sorry for that ;).

[Updated on: Thu, 03 February 2022 10:06] by Moderator

Re: [CDO] Rare problem in permission cache [message #1849820 is a reply to message #1849819] Thu, 03 February 2022 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Great!! Your proposed fix seems to work!

Just out of curiosity: why is this so hard to reproduce?
Re: [CDO] Rare problem in permission cache [message #1849834 is a reply to message #1849820] Thu, 03 February 2022 23:56 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the verification. Please submit a bugzilla.
Re: [CDO] Rare problem in permission cache [message #1849839 is a reply to message #1849834] Fri, 04 February 2022 02:54 Go to previous message
Eclipse UserFriend
I created this ticket:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=578577
Previous Topic:Short Survey About Requirements Engineering
Next Topic:Suspected inconsistencies in URIHandler.exist
Goto Forum:
  


Current Time: Fri Jul 11 08:33:32 EDT 2025

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

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

Back to the top