Skip to content

[Cache] The cache does not work with a NFS filesystem  #33392

@maidmaid

Description

@maidmaid

Symfony version(s) affected: 4.2.10

Description
The cache component desn't work with a NFS filesystem because of the flock() function calls done by the LockRegistry :

if (flock($lock, LOCK_EX | LOCK_NB)) {

Indeed, the flock() function itself is not reliable with a such filesystem.

How to reproduce

php -r "var_dump(flock(fopen('/file-on-nfs-filesystem', 'r+'), LOCK_EX | LOCK_NB));"
// always returns bool(false)

Possible Solution

We could bypass the locking mechanism if we know we are on a NFS filesystem.

Additional context

I tried to use the cache component into a vagrant with NFS synchronised files but I can't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions