Repository navigation
Description
Summary
During a long graphify extract semantic pass against a local Ollama backend, the run froze indefinitely (observed 20+ minutes, would not self-recover) after the Ollama server stopped responding. --api-timeout 180 was set but did not abort the stuck request. This appears to be a missing/ineffective client-side read timeout on the Ollama path, so a wedged server hangs the whole extract with no error and no adaptive-retry.
Observed behavior
- Semantic extraction progressed normally (e.g.
chunk 40/86 done), then froze — log stopped, no new chunks. graphifyprocess at 0% CPU (blocked on a socket read, not working).- Ollama had the model loaded but was idle (~0.2% CPU).
- A fresh, independent
curl http://localhost:11434/api/generate -d '{"model":"...","prompt":"ok","stream":false}'also hung >15s — confirming the Ollama server itself had wedged, not graphify. - The stuck extract never errored or retried; it sat on the dead read until killed. Bouncing
ollama+ re-running was the only recovery.
Notably this occurred with --api-timeout 180 set, so whatever timeout is applied to the OpenAI-compatible client (_resolve_api_timeout() in llm.py) did not fire on this Ollama request. Possible causes I can't fully confirm from the outside: the timeout not covering a streaming read, or a per-chunk "hollow response" (I saw output_tokens≈35 truncation warnings just before the freeze) resetting the read clock so a slow trickle never trips the total timeout.
Impact
A single wedged local-LLM request silently stalls an entire multi-hour extract with no error, no progress, and no recovery — easy to mistake for "still working" since the process is alive.
Suggestions
- Ensure
--api-timeoutapplies as a hard wall-clock read timeout to Ollama requests (including streaming reads), so a hung server aborts the request and lets adaptive-retry fire instead of blocking forever. - Consider a heartbeat/stall detector: if no chunk completes within N× the per-chunk expected time, fail the chunk (retryable) rather than block.
- Surface a clear "backend appears unresponsive (no bytes in Ns)" error instead of a silent hang.
Environment
- graphifyy 0.9.5,
--backend ollama,--max-concurrency 1, modelsqwen3-coder-next(extract) /qwen3.5:122b(label), macOS, local Ollama.
I can't hand you a deterministic repro (it depends on the Ollama server wedging under sustained load), but the 0%-CPU-graphify + idle-Ollama + independently-hung-curl signature was reproducible across three separate stalls in one session.
Activity
Fix: cap Ollama client-side retries so a hung request cannot multiply…
safishamsi commentedon Jul 6, 2026
Fixed on
v8(21b851b), shipping in the next release.A stalled Ollama request wedged for
timeout * (max_retries + 1), so with the default 6 retries one long stall became a ~21-minute block._call_openai_compatnow defaults the Ollama backend to zero client-side retries (a local model that stalls will not un-stall on retry); setGRAPHIFY_MAX_RETRIESto opt back in. Other backends are unchanged.Honest caveat: this bounds the wait to a single
--api-timeoutwindow, but the underlying stall is driven by the model server and is non-deterministic, so it is not eliminated at the source. If you can still reproduce an indefinite hang within one timeout window, please reopen with the model and--api-timeoutvalue. Thanks for the report.Release 0.9.8
Fix: cap Ollama client-side retries so a hung request cannot multiply…
Release 0.9.8