Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2223 closed defect (bug) (fixed)

Cache flusher is not working reliably

Reported by: ryan Owned by: ryan
Milestone: Priority: normal
Severity: normal Version: 2.0
Component: Administration Keywords: bg|has-patch
Focuses: Cc:


On some setups, the flusher doesn't seem to work at all resulting in strangeness following upgrades. I suspect the problem is with our fallback glob(). Replace the flush code with something better.

Attachments (1)

cache.php.diff (1.6 KB) - added by ringmaster 12 years ago.
Patch alluded to in comments.

Download all attachments as: .zip

Change History (6)

#1 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#2 @ryan
12 years ago

  • Milestone changed from 2.1 to 2.0.1

#3 @ringmaster
12 years ago

  • Keywords bg|has-patch added
  • Resolution fixed deleted
  • Status changed from closed to reopened

I had some problems with this hanging on Windows/Apache. Possibly relates to #2278.

It's not entirely that the cache directory uses the wrong slash by default (forward slashes usually work on Windows in PHP anyway) but that rm_cache_dir() only rtrim()s the system slash when the string is hardcoded to contain a forward slash by default.

And then when it fails to delete a directory, the directory is continuously added back into the stack, causing the hang. This could be a problem on systems that - for some crazy reason - have had an errant permission change on a cache directory making it undeleteable.

The attached patch queues all directories that are scheduled for deletion into the stack first, deleting files as it goes, then flips the stack and deletes the directories from the deepest out to the shallowest. It can still fail to delete a directory, but such an error won't cause an infinite loop.

12 years ago

Patch alluded to in comments.

#4 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [3465]) Cache flush improvements from Owen. fixes #2223 #2278

#5 @(none)
11 years ago

  • Milestone 2.0.1 deleted

Milestone 2.0.1 deleted

Note: See TracTickets for help on using tickets.