I am running a website where we are serving a large amount of files from a folder mounted over Fuse (cloudfuse – a Rackspace Cloudfiles container), it works wonderfully most of the time however every now and again the Fuse connection stalls and all my Apache processes hang waiting for a file_exists() function to return.
My question, is there anyway to set a timeout for a specific function or to use another function to check if the file exists but return with false if function takes longer than x seconds?
I think
file_exists()is only simple function, and is not intended for such operations.Workaround #1 (quite elegant)
Workaround #2 (simpler, not elegant at all)