Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs(resource-cleanup): record /api/v1/health FD diagnostics, drop stale fd_monitor.py refs (#4917)

LearningCircuit3fb71f022f83
diff --git a/docs/developing/resource-cleanup.md b/docs/developing/resource-cleanup.md
index a3f53aa5bb..6f52d60883 100644
--- a/docs/developing/resource-cleanup.md
+++ b/docs/developing/resource-cleanup.md
@@ -719,8 +719,15 @@ failures to WARNING — check the logs for `Error disposing engine for
`connection_cleanup.py:184`, fires every 5-minute cleanup tick.
- **`High FD count (N)` WARNING** at `connection_cleanup.py:190`
when FDs exceed 800. The single most useful production signal.
-- **`fd_monitor.py`** (PR #3036) — cross-platform helper used by
- diagnostic endpoints.
+- **`GET /api/v1/health` resource diagnostics** (PR #4915) — for
+ *authenticated* callers the response carries a `resources` block
+ (`fd_count`, `fd_soft_limit`, `fd_hard_limit`, `fd_usage_percent`,
+ `thread_count`) and flips `status` to `"warning"` above 70% FD usage.
+ This is the live, queryable form of the `_count_open_fds()` log
+ signal — `curl` it during a leak hunt instead of grepping container
+ logs. It returns counts only (never fd targets), so no open file
+ paths or socket peers are exposed. Anonymous callers (the Docker
+ healthcheck) get only the basic `status`/`message`/`timestamp`.
- **In-CI FD-growth canaries** in
`tests/utilities/test_close_base_llm.py`. These run on every PR:
- `TestCloseBaseLLMRealHttpxAsync::test_no_fd_growth_across_repeated_close_cycles`
@@ -903,11 +910,18 @@ reference this section first.
Useful in principle, deferred — high false-positive risk
(caller-passed LLMs, lazy-init holders, factory-returned LLMs all
legitimately don't close). Needs a careful design.
-- **Dedicated `/api/v1/health/fd` diagnostic with eventpoll-inode
- dedupe.** PR #3033 stalled at a basic version (Windows + RLIM_INFINITY
- bugs); PR #3036 added `utilities/fd_monitor.py` for cross-platform FD
- reading. A type/inode-breakdown extension is feasible but deferred
- until an active leak hunt actually needs it.
+- **Per-FD-type/inode breakdown on the health endpoint.** The basic
+ version — aggregate FD count, limits, and usage percent on
+ `GET /api/v1/health` — shipped in PR #4915 (see section 4). The two
+ earlier attempts were closed rather than merged: PR #3033 (superseded
+ by #4915, a clean reapplication onto current main) and PR #3036 (a
+ `utilities/fd_monitor.py` FD circuit breaker — closed because its
+ premise, a retry-driven "death spiral," did not match the real
+ WAL/SHM-handle root cause already handled by the periodic pool
+ disposal above; `fd_monitor.py` was never merged and does not exist).
+ A type/inode breakdown (eventpoll vs pidfd vs WAL — the histogram the
+ section-1 `/proc` snapshot produces) is feasible but deferred until an
+ active leak hunt actually needs it.
- **Automated reproduction of #3816's eventpoll-FD leak in a test
suite.** Explored in closed PR #3930 — a single-thread
`asyncio.run(ainvoke)` loop against real Ollama does *not* reproduce