Repository navigation
fix: isolate hooks from model response backpressure - #1769
greysonlalonde merged 4 commits into
Conversation
Signed-off-by: Bryan Bednarski <[email protected]>
|
No actionable comments were generated in the recent review. WalkthroughThe daemon maintains separate pooled worker clients for model traffic and hook/readiness traffic. Worker staging attaches both clients. Readiness probes and hook routes use the hook client; provider routes use the model client. ChangesWorker traffic isolation
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Broker as Daemon broker
participant Pool as WorkerClientPool
participant Worker
Broker->>Pool: Get hook client for TLS root
Pool-->>Broker: Return hook client
Broker->>Worker: Send readiness or hook request using hook client
Broker->>Worker: Send provider request using model client
Merge Risk:
|
Signed-off-by: Bryan Bednarski <[email protected]>
mnajafian-nv
left a comment
There was a problem hiding this comment.
Non-blocking test suggestion.
Signed-off-by: Bryan Bednarski <[email protected]>
Signed-off-by: Bryan Bednarski <[email protected]>
ptimizeroracle
left a comment
There was a problem hiding this comment.
i modelled the daemon to worker hop standalone (hyper 1.11.1 client with the pooled_builder() + http2_only settings, h2 server with the 8 MiB window) and held model responses unread. one shared pool: a tiny hook stalls from the 3rd unread stream (hyper client defaults are 5 MiB connection / 2 MiB stream). second pool: hook done in under 1.2 ms up to 32 unread, 2 tcp connections instead of 1. so the split does what it says. gap: diagnostic_collection::fetch (diagnostic_collection.rs:230) still uses target.client() under a 2s COLLECTION_REQUEST_TIMEOUT, so that poll should time out under the same backpressure. move it to hook_client() or say why not. i did not run the pr branch.
(ai-assisted, checked by me)
Overview
Unread model responses can exhaust the shared daemon-to-worker HTTP/2 response window, stalling hook verdicts while
/healthzremains healthy. Give hooks and readiness probes a separate persistent pool. The regression starves hooks with eight unread responses before the fix and completes hooks with 128 after it.Details
Validation: 30 focused transport/TLS tests, staged pre-commit hooks, and docs checks passed. Full
NEXTEST_TEST_THREADS=4 just test-rust: 6,724 passed, 4 failed, 4 skipped. The same four HTTP-model provider timeouts reproduce on untouched release6b7afd500with workspace features; main stabilizes those unrelated paths in #1632. Fern skipped authenticated redirect checking.Where should the reviewer start?
Start with
WorkerClientPoolincrates/cli/src/daemon/common/worker_tls.rs,forward_to_workerincrates/cli/src/daemon/broker/server.rs, andcrates/cli/tests/coverage/daemon/hook_pool_isolation_tests.rs. The regression uses production worker staging.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
Reliability
Documentation