Skip to content

Reactor pool: sendFile() is not supported on worker responses #105

Closed

Description

@EdmondDantes

Under TRUE_ASYNC_SERVER_REACTOR_POOL=1 a handler that calls $response->sendFile() gets no delivery: the worker-side stream ops (src/core/worker_dispatch.c, worker_stream_ops) have no send_file op, and the dispose path renders only the buffered body — the send-file request is silently dropped.

Local (non-pool) H1/H2/H3 all deliver sendFile via their per-protocol pumps.

Possible shapes:

  • a dedicated wire kind that hands the (path, offset, length) to the reactor and runs the existing reactor-side sendfile pump (http3_static_response.c already pumps files on the reactor for the static path), or
  • reuse the static-handler HARD_ZERO machinery with the worker only resolving/validating the file.

Until then sendFile() under the pool should at least fail loudly instead of dropping.

Context: the streaming reverse path (STREAM_HEADERS/CHUNK/END/ABORT wires, credit backpressure) landed in PR #104 — sendFile is the one remaining response mode not marshalled across the split.

Activity

  1. added
    bug
    on Jul 7, 2026
  2. EdmondDantes commented on Jul 9, 2026

    @EdmondDantes
    ContributorAuthor

    Fixed in PR #113 — worker marshals a RESPONSE_WIRE_SEND_FILE wire; reactor opens the file and runs the shared sendfile engine. Also fixed a latent H3 stream-release slot-leak/UAF (stable reactor_owned flag). Regression test: tests/phpt/server/h3/049-h3-reactor-pool-sendfile.phpt.

  3. added a commit that references this issue on Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions