cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ellis Pritchard (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (COCOON-2152) EventAware cache does not persist correctly when using the StoreEventRegistryImpl
Date Wed, 28 Nov 2007 10:00:44 GMT

    [ https://issues.apache.org/jira/browse/COCOON-2152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546183
] 

ellispritchard edited comment on COCOON-2152 at 11/28/07 1:59 AM:
-------------------------------------------------------------------

To pre-empt Ard the problem is that after persist() is called the Cache has not actually been
shut down yet (due to Disposable), and therefore the newly added event entry has not been
written to disk. Thus emptying the map immediately after adding the entry to the Cache will
empty the very instance in the Cache, and result in the storing of an empty map.

This only happens with StoreEventRegistryImpl, which was only made the default (I believe)
in 2.1.10.

DefaultEventRegistryImpl  does work, and did before the issue fixed by COCOON-2146 was introduced
(also in 2.1.10), since it does the persisting itself, and the event map is already written
to disk by the time clear() is called.

I have patched this locally and it now works as expected.

[I actually was able to start to get to the bottom of the issue by switching back to DefaultEventRegistryImpl
 and noticing that events were correctly restored in this case, which lead me to start thinking
about what was different between the two implementations, then I banged my head against the
debugger for an hour and got nowhere, got called off to conduct an interview, and when I came
back realized what was actually going on!]

      was (Author: ellispritchard):
    To pre-empt Ard, the problem is that after persist() is called the Cache has not actually
been shut down yet (due to Disposable), and therefore the newly added event entry has not
been written to disk. Thus emptying the map immediately after adding the entry to the Cache
will empty the very instance in the Cache, and result in the storing of an empty map.

This only happens with StoreEventRegistryImpl, which was only made the default (I believe)
in 2.1.10.

DefaultEventRegistryImpl  does work, and did before the issue fixed by COCOON-2146 was introduced
(also in 2.1.10), since it does the persisting itself, and the event map is already written
to disk by the time clear() is called.

I have patched this locally and it now works as expected.

  
> EventAware cache does not persist correctly when using the StoreEventRegistryImpl
> ---------------------------------------------------------------------------------
>
>                 Key: COCOON-2152
>                 URL: https://issues.apache.org/jira/browse/COCOON-2152
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Event Cache
>    Affects Versions: 2.1.10, 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)
>            Reporter: Ellis Pritchard
>
> When using the DefaultEventRegistryImpl the functionality now works as expected (events
are persisted and restored) after the patch applied in COCOON-2146.
> However, there's still a problem with StoreEventRegistryImpl.
> The behaviour is that it doesn't seem to actually write/restore any event entries: the
maps in the EventRegistryDataWrapper are empty (but not null) after restart, even though the
actual cache entry (key EVENTREGWRAPPER) was found in the Store, and the entries were present
when persist() was called.
> The effect of this is to correctly restore the cached entries, but discard all the events,
which means that event-flushes don't work any more, which is not a good thing.
> I've tracked this down to the fact that AbstractDoubleMapEventRepository#dispose() which
performs the persist(), then immediately clear()s the maps, WHICH HAVEN'T YET BEEN WRITTEN
TO DISK BY EHCACHE SHUTDOWN!
> This code has probably never worked :)
> Patches to follow; I propose modifying dispose() to null the map fields, but not perform
clear() on them.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message