You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Marcel Reutegger (Jira)" <ji...@apache.org> on 2025/08/07 12:26:00 UTC

[jira] [Commented] (OAK-11845) Make SecureNodeBuilder thread safe

    [ https://issues.apache.org/jira/browse/OAK-11845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18012568#comment-18012568 ] 

Marcel Reutegger commented on OAK-11845:
----------------------------------------

While I have a hard time finding it explicitly written in a contract, I'm quite certain NodeBuilder is not considered thread-safe. E.g. take MemoryNodeBuilder which is the base class for both SegmentNodeBuilder and DocumentNodeBuilder. Internally it uses MutableNodeState to keep track of the builder state. Maps in MutableNodeState are not thread-safe.

I think making SecureNodeBuilder thread-safe will just treat a symptom, but not solve the actual problem. The implementation is supposed to synchronize access to NodeBuilder instances when a JCR Session is accessed concurrently by multiple threads.

https://jackrabbit.apache.org/oak/docs/dos_and_donts.html#anti-pattern-concurrent-session-access

> Make SecureNodeBuilder thread safe
> ----------------------------------
>
>                 Key: OAK-11845
>                 URL: https://issues.apache.org/jira/browse/OAK-11845
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: core
>            Reporter: Manfred Baedke
>            Assignee: Manfred Baedke
>            Priority: Major
>
> The member variable treePermission in particular may currently been set to null by a concurrent thread calling the method #baseChanged() during the execution of #getTreePermission().



--
This message was sent by Atlassian Jira
(v8.20.10#820010)