Skip to content

Serving engine wedges under real agent traffic on 6b68b9b4: /v1/responses + reasoning_effort=100 + long shared prefixes + client cancels (health 200, GPU idle, zero logs) #319

Closed

Description

@ouyyy18

Title: Serving engine wedges under real agent traffic on 6b68b9b4: /v1/responses + reasoning_effort=100 + long shared prefixes + client cancels (health 200, GPU idle, zero logs)

Environment

  • Flare: built from source @ 6b68b9b4 using the repo Dockerfile (binary reports 0.0.0 — version stamping needs tags in the build context)
  • Previous runtime 972e28e4 (release image release-972e28e-main-20261107) serves the same traffic without issue
  • Hardware: 4× RTX PRO 6000 Blackwell Max-Q (SM120), driver 610.57.04, single host TP4
  • Package: WARMIND-1017-FLARE-CSF v1.1 (gb202-tp4-202611160646, 191 files, sha256 verified)
  • Serve flags: --mtp-draft-tokens 7 --mtp-adaptive-verification --mtp-adaptive-verification-alpha 1 --scheduler-policy throughput --embedding-table-storage ram --kv-cache-limit memory --max-concurrency 32
  • Frontend: OpenAI-compatible proxy on :30001 normalizing reasoning.effort → top-level reasoning_effort;
    client disconnects propagate as request-context cancellation to Flare

Symptom

~10–20 minutes into production traffic the engine stops serving entirely:

  • /health keeps returning 200 (HTTP threads alive)
  • New generation requests hang forever (no headers, no error)
  • All 4 GPUs at 0% utilization
  • Zero log output from the runtime — no panic, no error, nothing after the normal startup banner
  • 5 in-flight proxy handler goroutines never return; recovery only via container restart

The same workload class on 972e28e4 runs 18+ hours without issue. A pure benchmark
(/v1/chat/completions, thinking disabled, KB-size prompts, requests run to completion,
direct to the engine port) did not trigger the wedge in 40 minutes on 6b68b9b4.

Trigger profile (from the wedge window's proxy access log)

51 requests / 20 minutes, of which 5 hung permanently:

  • Endpoint: /v1/responses — 45/51 (88%)
  • Reasoning: explicit reasoning.effort: 100 (max) on 39/51
  • Payload: 67–73 KB bodies growing to 320–420 KB (~17k–105k token prompts) from agent-style
    retry loops with long shared prefixes
  • Client behavior: 300-second client timeouts → mid-generation aborts
    (proxy logs completions at in 299.99s), i.e. steady stream of cancellations
  • After rollback to 972e28e4, the identical agent traffic completes normally (0.5–8 s/request)

Suspected area

972e28e4..6b68b9b4 contains ~120 commits. The wedge signature (scheduler stops admitting
work while the HTTP layer stays healthy and GPUs idle) suggests a leaked request/snapshot slot
or an internal bounded-channel deadlock reached through the request-cancellation path. Relevant
changes in that window:

The pattern also resembles #189 (bounded record backlog → link poisoned → "stops the server"),
and interacts with the behavior described in #199 (bounded per-request output queue cancels a
request whose consumer stalls — our proxy/clients can stall briefly on slow readers).

Reproducer

Deterministic-ish reproducer (Python, stdlib only) replays the four trigger factors against a
fresh 6b68b9b4 server: 12 workers × /v1/responses, reasoning_effort: 100, ~350 KB shared-prefix
contexts growing ~4 KB/round, 70% of requests aborting mid-stream after 2–8 s, canary probe every
20 s.

Results (3 runs):

  • Run 1: full wedge at ~8 min (canary dead, GPU idle, 0 errors logged)
  • Run 2: full wedge in <60 s (19 requests, 0 tokens streamed)
  • Run 3: intermittent multi-second stalls for 15 min (canary flap) — captured with maps + unstripped binary

Wedge anatomy (gdb thread apply all bt, symbolized)

All three rank threads sit at the scheduler refresh barrier:

flare-rank-1/2/3:
  flare_helios::scheduler::refresh::RefreshState::complete
  → std::sync::mpmc::zero::Channel<T>::read      (rendezvous never completed)

flare-model ×2:
  flare_helios::server::runtime::Worker::run
  → std::sync::mpmc::Receiver<T>::recv           (no work dispatched)

flare-http: alive (health 200), GPUs 0 %, zero log output

The refresh coordinator never consumes the rendezvous, so ranks park forever and no further work
is scheduled. In the fully-wedged capture one flare-model thread is busy executing (spinning)
inside model/scheduler code instead of parked — consistent with a livelocked refresh loop holding
the barrier token.

Both files appearing in the deadlocked frames were modified in 972e28e4..6b68b9b4:

  • 29192ef Preserve prefix-cache reuse under resource pressure #298 “Preserve prefix-cache reuse under resource pressure” — touches scheduler.rs and server/runtime.rs
  • 617ef92 “Allocate checkpoint slots globally within request work budgets” — touches scheduler.rs/policy_tests.rs

Our reproducer deliberately creates resource pressure on the prefix cache (12 concurrent ~350 KB
shared-prefix contexts) plus mid-generation cancellations — i.e. exactly the #298 / 617ef92
code paths.

Ask

  1. Can the refresh-barrier rendezvous in RefreshState::complete be starved/deadlocked when
    prefix-cache pressure handling (Preserve prefix-cache reuse under resource pressure #298) or global checkpoint-slot budgeting (617ef92) interacts
    with cancelled requests?
  2. Full evidence bundle available: symbolized all-thread backtraces (wedged + degraded states),
    /proc maps, unstripped binary build recipe, proxy access logs, reproducer script.

Activity

  1. ouyyy18 commented on Nov 18, 2026

    @ouyyy18
    Author

    Root cause confirmed and a minimal fix proposed in #326 — select_snapshots's pair enumeration degrades to O(n²·pages) under shared prefixes (single quote = 9.4 s measured offline on the exact function); capping pair candidates to 128 restores ~40 ms quotes. Live validation: 15 min of the wedge-triggering load with zero stalls on the patched build, decode throughput unchanged (C16 −1.2 %, C32 −0.7 %). Symbolized stacks, offline reproducer test, and bench numbers are included in the PR.

  2. added
    area:scheduling
    bug
    priority:P1
    triage:investigate
    on Nov 18, 2026
  3. original-el8 commented on Nov 18, 2026

    @original-el8
    Collaborator

    The proposed fix #326 needs revision before it is safe to merge. I reproduced a functional regression in its first-128-ID truncation: a valid zero-page-cost snapshot at id 128, or a valid pair at ids 128/129, is discarded and the selector returns no allocation although main finds one. The review includes a minimal input and the affected line: #326 (review) . This does not dispute the measured planning blowup. It means the bounded-cost fix must preserve feasible allocation and cost ordering. #296/#329 address repeated selection work and should also be tested with this shared-prefix/cancellation workload, but their different measurements do not establish that this issue is fixed.

  4. added a commit that references this issue on Nov 18, 2026
    c8d8b67
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:schedulingbugpriority:P1triage:investigate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions