Skip to content

Make ignore_user_abort(true) requirement clearer (or automatic) in Worker Mode #2186

@mihitha

Description

@mihitha

Summary

This is an improvement suggestion regarding Worker Mode behaviour and documentation around ignore_user_abort(true).

While this setting is briefly mentioned in the documentation, its importance is easy to underestimate. In real-world usage, omitting it can lead to a situation where workers appear to hang completely under repeated aborted requests.

Clarifying this behaviour (or handling it automatically) could prevent significant debugging time for others adopting Worker Mode.

Context

I am running FrankenPHP in Worker Mode with a custom PHP framework.

During aggressive browser refreshes and concurrent API activity (a realistic scenario with SPAs and cancelled fetch requests), the server would eventually become fully unresponsive:

  • Requests stop being processed
  • No crash or error is logged
  • The FrankenPHP process remains alive
  • Restarting FrankenPHP immediately restores service

This did not occur under normal traffic, only when many requests were aborted mid-execution.

Investigation Experience

Because the failure mode looks like a server-level deadlock rather than a PHP behaviour issue, I initially investigated:

  • Thread limits / concurrency configuration
  • Memory exhaustion or leaks
  • Caddy configuration
  • PHP execution timeouts
  • Application-level locking

This took considerable time to isolate because nothing in logs or metrics pointed to aborted connections as the cause.

Suggested Improvements

One of the following could make this safer and easier to adopt:

  1. Automatically enable ignore_user_abort(true) in Worker Mode, since persistence changes the execution model.
  2. Emit a startup/runtime warning if Worker Mode is used without it.
  3. Expand the documentation to clearly explain:
    • Why it matters in Worker Mode
    • The type of hangs it can cause
    • That it is effectively required for most web workloads

This is not reporting a defect, but highlighting a sharp edge that is easy to miss and difficult to diagnose once encountered.

Making this behaviour more explicit would greatly smooth the onboarding experience for developers moving from request-isolated PHP environments to FrankenPHP Worker Mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions