8000 Use flock() based locking in HttpCache instead of lock files · Issue #16777 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Use flock() based locking in HttpCache instead of lock files #16777
Closed
@mpdude

Description

@mpdude

This is a follow-up for #15813 (comment).

When a PHP process crashes or terminates (maybe the OOM killer kicks in or other bad things ™️ happen) while the HttpCache holds a .lck file, that lock file may not get unlink()ed.

The result is that other requests trying to access this cache entry will see a few seconds delay while waiting for the lock; they will eventually continue but send 503 status codes along with the response. The sudden buildup of PHP processes caused by the additional delay may cause further problems (sudden load increase).

One solution might be to use the LockHandler from the Filesystem component. It applies flock()-based locking, so the lock will automatically be released when the process holding it terminates.

As the LockHandler was added in 2.6, this is not a bugfix we could provide for 2.3.

(Yes, I've seen this happen quite a few time in practice.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0