Skip to content

Adding a clearFsStatCache flag to the local filesystem adapter for NFS cache issues#1902

Open
Samuel-Salter wants to merge 3 commits into
thephpleague:3.xfrom
castusdesign:3.x
Open

Adding a clearFsStatCache flag to the local filesystem adapter for NFS cache issues#1902
Samuel-Salter wants to merge 3 commits into
thephpleague:3.xfrom
castusdesign:3.x

Conversation

@Samuel-Salter

Copy link
Copy Markdown

This is my first PR here, I ran into an issue and instead of just reporting it I thought I would contribute a potential solution, apologies if that's not appropriate and you would rather I went through other channels, I'm very happy to do that.

The issue I ran into was that is_dir as called in the directoryExists method of the local adapter was returning false in my AWS EFS setup for a directory that exists, and I could make it appear by calling ls. After some digging I found that NFS has a cache layer that isn't cleared by is_dir (which uses stat under the hood) but it is possible to warm that cache with other commands.

I don't think the behaviour I am adding in appropriate for most circumstances, it is adding extra file system calls to some pretty basic requests, which only really make sense in an NFS context. So I thought it would make sense as a constructor boolean option, and it could be activated by people using network file systems who want to cache-bust and are willing to pay the performance cost.

Like I have said, very open to feedback or to modify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant