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

Alejandro Moratinos commented on OAK-11111:
-------------------------------------------

While checking if the stale cache has to be served or not it was only checking 
if by the expiration time it was able to serve the stale cache without checking 
if there were values stored in the cache. 

Filed a PR to change the behaviour and check if stale cache can be served and 
if there are values to serve. 

[https://github.com/apache/jackrabbit-oak/pull/1715] 

> CachedPrincipalMembershipReader could return empty principal under concurrency
> ------------------------------------------------------------------------------
>
>                 Key: OAK-11111
>                 URL: https://issues.apache.org/jira/browse/OAK-11111
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.68.0
>            Reporter: Alejandro Moratinos
>            Assignee: Alejandro Moratinos
>            Priority: Major
>
> CachedPrincipalMembershipReader can be configured to define a stale time 
> during which an outdated principal list is returned while the cache is being 
> refreshed. 
> If a stale time is configured then there will be a period when the cache it's 
> being updated by one request thread 
> ([here|https://github.com/apache/jackrabbit-oak/blob/9ca692077b7a8c3f43f42895a4c3ba93d0614011/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/CachedPrincipalMembershipReader.java#L128-L131])
>  and others request could serve an empty list of principals because the 
> property that contains [the cached principal list is not written 
> yet|https://github.com/apache/jackrabbit-oak/blob/9ca692077b7a8c3f43f42895a4c3ba93d0614011/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/CachedPrincipalMembershipReader.java#L180-L191].
>   This can happens depending on the concurrency level and the time it takes 
> to build the principal list from one thread.
> Also that could happen only if the property is not present which could only 
> occur the first time the cache is being built as the property is not being 
> deleted afterwards. 



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

Reply via email to