Development

#1457 ([PATCH] sfProcessCache doesn't work after clearing cache)

You must first sign up to be able to contribute.

Ticket #1457 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] sfProcessCache doesn't work after clearing cache

Reported by: vanchuck Assigned to:
Priority: minor Milestone: 1.0.0
Component: Version: 1.0.0-rc1
Keywords: Cc:
Qualification:

Description

in sfProcessCache, the type of memory cacher used is determined the first time a memory cache operation is executed, and the result of the detection is saved in a static variable.

However, because of how sfProcessCache::clear() is called in the sfConfigCache file, it is called repeated times (20 times, once for each config file that is supposed to be cached!), and the first 3 times, no config file settings have been loaded yet. In the detection method, it checks for the existence of a config setting called "sf_use_process_cache" to make sure is hasn't been disabled by an app's settings. However, since this has not been loaded the first time sfProcessCache::clear() is called, it is assumed that this value is 'false' and so the sfProcessCache is disabled entirely, and because the detection method caches it's result, it is not available for the duration of the hit.

I have attached a patch which fixes this. First, it ONLY calls sfProcessCache::clear() IF that config setting exists. Second, it keeps track, as a static variable, whether or not the clear() method has been called or not yet. This means it is only called once.

Attachments

sfConfigCache.diff (0.9 kB) - added by vanchuck on 02/15/07 08:15:56.

Change History

02/15/07 08:15:56 changed by vanchuck

  • attachment sfConfigCache.diff added.

02/15/07 22:51:07 changed by vanchuck

some clarification in case it is needed:

this is only occurring for the 1 page access immediately following a 'symfony cc' command. The next page hit after that works fine.

After the cache is cleared, the cached config files do not exist. It is the absence of these files which triggers the attempt to clear the sfProcessCache, during which the problem described above occurs.

02/18/07 09:49:29 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [3490]) fixed sfProcessCache doesn't work after clearing cache (closes #1457 - patch from vanchuck)

02/18/07 09:49:42 changed by fabien

  • milestone set to 1.0.0.