jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-5296) MutableRoot.refresh does not correctly refresh tree permissions
Date Tue, 20 Dec 2016 16:29:58 GMT

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

Michael Dürig commented on OAK-5296:

I can't find a problem here: even though {{MutableRoot.refresh()}} (indirectly) causes a call
to {{SecureNodeBuilder.getTreePermission()}}, that one will only trigger recompiling the permissions
if the permission provider is not cached already. In that case however, the permission provider
is based on a recent node state. 
If the permissions provider is cached, no recompiling of the permissions will happen and the
permissions provider will be correctly refreshed subsequently within {{MutableRoot.refresh()}}.

The only remaining issue is the call to {{SecureNodeBuilder.getTreePermission()}} in {{SecureNodeBuilder.baseChanged()}},
which IMO could be removed as its result will be invalidated by the subsequent refreshing
of the permission provider. 

> MutableRoot.refresh does not correctly refresh tree permissions
> ---------------------------------------------------------------
>                 Key: OAK-5296
>                 URL: https://issues.apache.org/jira/browse/OAK-5296
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>            Priority: Blocker
>             Fix For: 1.6
> Consider the following excerpt of a stack trace:
> {noformat}
> at org.apache.jackrabbit.oak.security.authorization.permission.PermissionProviderImpl.getCompiledPermissions(PermissionProviderImpl.java:162)
> at org.apache.jackrabbit.oak.security.authorization.permission.PermissionProviderImpl.getTreePermission(PermissionProviderImpl.java:104)
> at org.apache.jackrabbit.oak.core.SecureNodeBuilder.getTreePermission(SecureNodeBuilder.java:356)
> at org.apache.jackrabbit.oak.core.SecureNodeBuilder.baseChanged(SecureNodeBuilder.java:166)
> at org.apache.jackrabbit.oak.core.MutableRoot.refresh(MutableRoot.java:236)
> {noformat}
> {{MutableRoot.refresh()}} [ends up calling | https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableRoot.java#L236]
{{PermissionProviderImpl.getCompiledPermissions}}, which in turn uses the current (not yet
fully refreshed) root for compiling the permissions. The permissions provider (and its root)
are [refreshed|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableRoot.java#L239]
only afterwards. 

This message was sent by Atlassian JIRA

View raw message