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 "Michael Dürig (JIRA)" <ji...@apache.org> on 2014/03/05 09:28:50 UTC

[jira] [Commented] (OAK-1497) JackrabbitEvent#isExternal() returns true for internal changes for slow listeners

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

Michael Dürig commented on OAK-1497:
------------------------------------

One approach is to extend the {{JackrabbitEvent}} API:

# Change {{isExternal()}} return type from {{boolean}} to {{Boolean}} and return {{null}} for don't know.
# Change {{isExternal()}} to throw an {{IllegalStateException}} for don't know.
# Change {{isExternal()}} to {{throws RepositoryException}} and throw for don't know.
# Add an entirely new API

1. is a hack and would probably cause NPE in many places in the code, which will be quite hard to track down.
2. is similar to 1. just with a different exception and thus being a bit more explicit. 
3. Is even more explicit and will force clients to handle this case through the type system.
4. Is probably the least invasive approach but will leave the problem lurking...

> JackrabbitEvent#isExternal() returns true for internal changes for slow listeners
> ---------------------------------------------------------------------------------
>
>                 Key: OAK-1497
>                 URL: https://issues.apache.org/jira/browse/OAK-1497
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>            Reporter: Michael Dürig
>             Fix For: 0.18
>
>
> Oak degrades gracefully for observation listeners that can't keep up with the rate of observation events fired. See {{BackgroundObserver#contentChanged}} for the gory details. 
> As a side effect {{JackrabbitEvent#isExternal}} will always return {{true}} when this degradation happens. However there is currently no way for clients to detect this and to thus know whether the result of {{JackrabbitEvent#isExternal}} is reliable or not. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)