For a reason I have yet to discover, the www user on our server was suddenly unable to write to the ~/wurfl/cache/FILE_CACHE_PROVIDER directory this afternoon. Rather than fail gracefully and log a watchdog error, this led to a fatal error in wurfl.module, immediate WSOD and complete failure of all our sites.
It is possible to check is_writable() for a folder before attempting to write into it. Can we add this to the module to prevent such total devastation if the cache fails to be writable again?
Comments
Comment #1
martin_qI have written a little module to catch the exception and attempt a page-reload after a short delay. This will only attempt up to three reloads and will stop if pages are already loading slowly. Meanwhile, a watchdog report will be written.
I have also changed FileManager.php so that lines 76 and 85 use @fopen and @fwrite respectively.
The module (in its entirety) looks like this:
I have yet to see if it will do the trick. Comments welcome.