Skip to content

h1: a file region sent on compio intermittently arrives with the wrong bytes #159

Open

Description

@lexoliu

Problem

skyzen's file_regions_and_their_ranges_go_through_send_file (tests/static_files.rs) failed once on Linux CI: a file above the static cache's inline limit, served as a FileRegion by http-kit-h1 0.6.1 over Compio::default() (http-kit-io 0.6.1) arrived with a body that differs from the file, on a plain loopback connection with no TLS. The same test passed on the previous runs of the same code, so the corruption is intermittent. The failing run: https://github.com/zen-rs/skyzen/actions/runs/43082231808/job/130737510855.

Candidates touched since the test last changed are the pipe reuse between frames (#154), registered files (#153) and SEND_ZC on the head (#152), each of which can put bytes out of order or reuse a buffer before the kernel is done with it.

Scope

Find the root cause in the send path of a file region on compio and fix it, with a regression test in this repository that fails without the fix.

Done when

The fix is merged and the regression test passes on Linux CI.

Activity

  1. added
    bugSomething isn't working
    area:ioRuntime-neutral I/O
    area:h1HTTP/1.1 protocol
    on Nov 11, 2026
  2. lexoliu commented on Nov 11, 2026

    @lexoliu
    CollaboratorAuthor

    Recurred with the server log printed (skyzen run 43110446903, Linux): the client read the 200 head, then 0 of 1,540,000 body bytes and a clean EOF. The server's last record is

    TRACE http_kit_h1::conn: sending a file region offset=0 len=1540000
    

    with nothing after it at the time the client saw EOF — no connection error, no close. So the whole region went out as nothing and the connection ended without an error being reported, which points at a send path that finishes a region on a zero-byte result (for example a splice that reads at the descriptor's shared offset, or an Ok(0) taken as done) rather than at bytes being reordered.

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

    area:h1HTTP/1.1 protocolarea:ioRuntime-neutral I/ObugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions