Skip Menu |

This queue is for tickets about the Cache-Cache CPAN distribution.

Report information
The Basics
Id: 12400
Status: resolved
Priority: 0/
Queue: Cache-Cache

People
Owner: dewitt [...] unto.net
Requestors: Dan [...] DWright.Org
merlyn [...] stonehenge.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.04
Fixed in: (no value)



Subject: Cache::FileCache "auto_purge_on_get => 1" goes into an infinite loop
$ perl -deal DB <1> use Cache::FileCache; DB <2> x Cache::FileCache->new({auto_purge_interval => '1 hour', auto_purge_on_get => 1}); Cache::CacheUtils::Assert_Defined(/opt/perl/snap/lib/site_perl/5.8.6/Cache/CacheUtils.pm:37): 37: if ( not defined $_[0] ) 38: { 100 levels deep in subroutine calls! Oops. And you have no tests for auto_purge_on_get either.
Sorry for not getting around to this earlier. (I guess I'm not a fan of the auto_purge methods anyway!) I'll look at it. Thanks!
I'm having the same problem (solution below). The problem is that _reset_auto_purge_interval loops. Here's a stack trace demonstrating the issue: Cache::BaseCache::_reset_auto_purge_interval('Cache::FileCache=HASH(0x8392a50)') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 511 Cache::BaseCache::_auto_purge('Cache::FileCache=HASH(0x8392a50)') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 556 Cache::BaseCache::_conditionally_auto_purge_on_get('Cache::FileCache=HASH(0x8392a50)') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 198 Cache::BaseCache::get('Cache::FileCache=HASH(0x8392a50)', 'Default') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 466 Cache::BaseCache::_reset_auto_purge_interval('Cache::FileCache=HASH(0x8392a50)') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 625 Cache::BaseCache::set_auto_purge_interval('Cache::FileCache=HASH(0x8392a50)', '12h') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 393 Cache::BaseCache::_initialize_auto_purge_interval('Cache::FileCache=HASH(0x8392a50)') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/BaseCache.pm line 337 Cache::BaseCache::_complete_initialization('Cache::FileCache=HASH(0x8392a50)') called at /usr/local/lib/perl5/site_perl/5.8.4/Cache/FileCache.pm line 90 Cache::FileCache::new('Cache::FileCache', 'HASH(0x811b168)') called at t/new2.t line 17 And here's one solution that seems to work: In Cache::BaseCache, update this line in sub get: $self->_conditionally_auto_purge_on_get( ) to this: $self->_conditionally_auto_purge_on_get( ) unless $self->get_namespace() eq $AUTO_PURGE_NAMESPACE; Regards, -Dan
From: DCLINTON
Thanks for the patch. I am testing it and applying it to the CVS copy right now. I'll push 1.05 out soon.