Skip to main content

await_serialize_target

Function await_serialize_target 

Source
async fn await_serialize_target(
    target: StreamKey,
    key: StreamKey,
    ctx: &ForwardCtx,
    report: &Reporter<'_>,
)
Expand description

Hold this stream until target ends — StreamAction::SerializeAfter.

The peer stream is already open (that is what the action says: open now, write nothing until), so what is being held is the first write on it. This function holds the whole pipe rather than gating one queued unit: the effect on the wire is identical — nothing is written — and the read is held with it, which is Overflow::Block’s own answer to the destination is not ready, not a new mechanism.

§Three ways this cannot hang the session

  1. Session cancellation is one of the three racers, so teardown is never waiting on a hook’s bookkeeping.
  2. EgressConfig::max_hold is the ceiling, so a target whose gate is somehow never released costs a bounded delay rather than a stream that lives forever. It is the same ceiling a Hold gets, for the same reason — a caller may not make a stream unkillable.
  3. A target that cannot end later than now resolves immediately and says so once. Three cases are one report: a key that was never forwarded, a stream that has already ended, and this stream. The third is the interesting one — a self-serialize is unsatisfiable by construction, and left unguarded it would be a max_hold stall attributed to the pacer rather than to the hook that asked for it.