Hi,
looking through Catalyst::Plugin::PageCache, there appear to be some 
race conditions, here's one example: (line ~253 of PageCache.pm):

         # Keep an index cache of all pages that have been cached, for use
         # with clear_cached_page

         my $index = $c->cache->get( "_page_cache_index" ) || {};
         $index->{$key} = 1;

         # Save date in cache
         $c->cache->set( "_page_cache_index", $index,
             $c->config->{page_cache}->{no_expire} );


Here, the index is retrieved, updated, and stored, non-atomically.
So, it would be quite possible for another process to have pulled the 
index out, adjusted a different key, before the first process had saved 
the key.. The first process then saves the entire index, and then the 
second process saves its own index, and overwrites the changes made by 
the first.


If using Cache::FastMmap, you can use the get_and_set() function to do 
atomic changes - I'm not sure about the other cache:: modules though.

Toby

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to