Download & Extend

Filesize errors caused by unlink

Project:Cache Router
Version:6.x-1.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)
Issue tags:filesize fread flock

Issue Summary

We're seeing some issues in beta8 with filesize errors:


Warning: filesize() [function.filesize]: stat failed for /nfs/silo2/v1/drupaldev/drupal_theme_tester/sites/default/cache/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables in /nfs/disk/data/www/httpd-docs/tools/drupal/6.10_200904200200/sites/all/modules/cacherouter/engines/file.php on line 41

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /nfs/disk/data/www/httpd-docs/tools/drupal/6.10_200904200200/sites/all/modules/cacherouter/engines/file.php on line 41

We've fixed the issue. It was due to filesize() not taking the file pointer and instead using the file name. Since the file was unlinked, filesize() errors, and then fread() tries to read a length of 0.

See the attached patch. It corrects the issue for get() and purge().

AttachmentSize
cacherouter-rc1-filesize-error-fix.patch1.5 KB

Comments

#1

Oh, forgot to mention that the patch has been generated from rc1 codebase.

#2

Here is V2 of the patch. My patch had a typo in the second section.

AttachmentSize
cacherouter-rc1-filesize-error-fix-V2.patch 1.51 KB

#3

Status:needs review» closed (duplicate)

What for file_exists dubble check
Lets continue with #578522: File engine: Performance, filenames, and other cleanup

nobody click here