Re: Discussion: Remove file statcache?

From: Date: Sun, 22 Dec 2024 09:42:19 +0000
Subject: Re: Discussion: Remove file statcache?
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-126164@lists.php.net to get a copy of this message
> I suppose a possible alternative would be to modify all file system >> mutation functions (file_put_contents(), touch(), etc.) to flush the cache, >> which for whatever reason doesn't happen now. That would be above my skill >> level, though, so someone else would need to do it. Also, I don't know if >> there's a good reason those functions don't clear the cache currently or if >> it was just an oversight. >> >> > As I said we could probably handle some stream cases more aggressively but > it won't resolve the problem completely. We still have things like > system("touch /file/path") which we cannot flush the stat cache for. And > it's not just shell access - there might be some 3rd party extensions that > operate on files or there might be other programs accessing files at the > same time. So there are many places which we just cannot control. > > Thinking about it, there might be a possibility to address it (at least on Linux) using fanotify. Not sure about other platforms but maybe there are some solutions to address it. Also it might get a bit complex and not sure how much the solution is viable. I guess we should first research and maybe PoC to which extend this can be actually fixed. I will try to prioritize it and look into it in the coming weeks. Regards Jakub

« previous php.internals (#126164) next »