Correctness: ai_broker_mother provider has no connection reuse #108

Open
opened 2026-05-11 13:50:39 +00:00 by thabeta · 0 comments
Owner

Severity: Medium

Location

crates/hero_aibroker_lib/src/providers/ai_broker_mother.rs

Finding

Each request to a mother broker creates a new HTTP client/connection:

rust\nlet response = client.post(&url).json(&body).send().await?;\n

No connection pooling or reuse between requests to the same mother broker.

Impact

  • TCP connection overhead per request\n- No HTTP/2 multiplexing benefits\n- Increased latency for cascade scenarios\n- Mother broker sees many short-lived connections

Recommendation

  • Use a shared reqwest::Client with connection pooling
  • Configure keepalive for mother broker connections\n- Set appropriate pool size limits
## Severity: Medium ## Location `crates/hero_aibroker_lib/src/providers/ai_broker_mother.rs` ## Finding Each request to a mother broker creates a new HTTP client/connection: ```rust\nlet response = client.post(&url).json(&body).send().await?;\n``` No connection pooling or reuse between requests to the same mother broker. ## Impact - TCP connection overhead per request\n- No HTTP/2 multiplexing benefits\n- Increased latency for cascade scenarios\n- Mother broker sees many short-lived connections ## Recommendation - Use a shared `reqwest::Client` with connection pooling - Configure keepalive for mother broker connections\n- Set appropriate pool size limits
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_aibroker#108
No description provided.