Commit 048c9ec
Paul C
v22.8.1: local-AI client fixes — fast-fail connect, no stale pool, source-chain errors
KO4BSR reported a 30+s "error sending request for url" against
Ollama-on-LAN with qwen2.5:3b in v22.8.0, where curl on the same host
worked in 8s. Three changes to the AI HTTP clients (AI_SIMPLE_CLIENT
and AiAgent::client):
* Drop the `local_address(0.0.0.0)` binding (the inter-node IPv6
bandaid). On hosts with policy routing or multiple default routes
it can pick a different egress route than the kernel's default,
which is why curl worked but WolfStack didn't.
* `pool_max_idle_per_host(0)` — local AI servers run in containers
that rotate; a stale pooled connection would stall the next
request for the kernel SYN budget (~30s) before failing. Fresh
TCP per call removes the stall.
* `connect_timeout(5s)` — without it, an unanswered SYN blocks for
~30s before reqwest gives up. Crisp 5s failure now; 120s outer
timeout still covers actual inference.
Plus diagnostic improvement: new `ai_connection_error` helper walks
`reqwest::Error::source()` and appends each cause to the message.
Operators now see "tcp connect error — deadline has elapsed" or
"connection refused" instead of just the opaque outer wrapper.
Verified locally: real Ollama@10.0.3.1 + qwen2.5:3b responds in 1.7s;
unreachable host fails in 5.4s with full source chain.1 parent c9b23ac commit 048c9ec
2 files changed
Lines changed: 51 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
27 | 47 | | |
28 | 48 | | |
29 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
30 | 52 | | |
31 | 53 | | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
35 | 74 | | |
36 | 75 | | |
37 | 76 | | |
| |||
509 | 548 | | |
510 | 549 | | |
511 | 550 | | |
512 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
513 | 557 | | |
514 | 558 | | |
515 | 559 | | |
| |||
2373 | 2417 | | |
2374 | 2418 | | |
2375 | 2419 | | |
2376 | | - | |
| 2420 | + | |
2377 | 2421 | | |
2378 | 2422 | | |
2379 | 2423 | | |
| |||
2870 | 2914 | | |
2871 | 2915 | | |
2872 | 2916 | | |
2873 | | - | |
| 2917 | + | |
2874 | 2918 | | |
2875 | 2919 | | |
2876 | 2920 | | |
| |||
0 commit comments