mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
The lot admitted every request before its resume lookup, so a full lot shed traffic to already-RUNNING actors — exactly the starvation docs/request-parking.md rules out (agent-substrate/substrate#1081), and TestHandleRequestHeaders_ParkingLotFull pinned that behavior as expected. Replace the resumer's singleflight.Group with a per-actor flight registry whose flights signal their park transition (the first retryable error). A caller now waits slot-free while its flight resolves, acquires a slot only once the flight parks, and is shed with the existing 503 "router at capacity" only at that transition — after the single attempt that revealed it would have to wait. Requests resolved on the first attempt never touch the lot, so a saturated lot cannot starve running-actor traffic, and parking.active / parking.wait.duration now count only genuinely parked requests.