Skip to content

I2156 — A slow or silent HTTP client cannot hold a server worker

Put a declared deadline on reading each request's head and body, close and count a connection that misses it, and keep handler time off the workers the probe needs.

DONE wave 0 · p1 · implementation profile · runs alone

Part of failure-is-visible — Every failure the runtime can suffer is bounded, tested or stated, and changes the health it reports.

Objective

Put a declared deadline on reading each request's head and body, close and count a connection that misses it, and keep handler time off the workers the probe needs.

Why

The HTTP server has four workers (apps/majordomus-cli/src/http/server.rs:23) and reads request bodies with no deadline (apps/majordomus-cli/src/http/server.rs:208-222). Four clients that open a connection and send slowly hold every worker; the lease probe then waits behind them (I2126) and a healthy server can be taken over. Bounded waits exist on the client side only: PROBE_TIMEOUT, BUSY_GRACE and JOIN_TIMEOUT (apps/majordomus-cli/src/lease.rs:43-62) and the link REQUEST_TIMEOUT of 5 s (apps/majordomus-cli/src/mesh/link.rs:76). The gates liveness-check and step-bound cover shell only, and no test has a slow client. Baseline audit of 2026-10-09 at master 1fb8d6be44, failure gap 5 and the slow-peer row.

Current state

Any client that reaches the port can occupy a worker indefinitely.

Desired state

Reading a request has a deadline declared beside the lease timings in policy.yaml server:, a connection that misses it is closed and counted in the server's diagnostics, and handler time is bounded or moved off the request workers.

Scope

  • apps/majordomus-cli/src/http/server.rs
  • apps/majordomus-cli/src/lease.rs
  • apps/majordomus-cli/src/policy.rs
  • .ai/repo/policy.yaml
  • share/schemas/majordomus/policy
  • apps/majordomus-cli/tests/http_serve.rs
  • docs/MCP.md

Dependencies

None. This issue is a root of the graph.

Acceptance criteria

  • Four clients that each send one byte per second hold no worker past the declared deadline, and a fifth client is answered
  • The deadline is a declared policy key and the count of connections closed by it appears in the server's diagnostics

Validation

  • bin/majordomus plan validate
  • cargo test --test http_serve --test mcp_shared

Evidence required

  • slow_client_released_test

Evidence

coverstypecommandresultat commit
slow_client_released_testtestcargo test --locked --manifest-path apps/majordomus-cli/Cargo.toml --test http_slow_client slow_client_released_testtest result: ok. 1 passed; 0 failed (run 2026-10-14 between 07:40Z and 07:58Z on master ce5959db59)ce5959d

Timeline

started
2026-10-14T08:01:59Z
verified
—
completed
2026-10-14T08:02:05Z

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I2156.yaml. Read it back with majordomus plan show I2156.

Searches the titles and descriptions of every page this site publishes.