You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #3565 (commit 82d5a78cb, 2025-10-23) added a prometheus_client.multiprocess.mark_process_dead(self._pid) call in SupervisedProc teardown, so dead job processes' multiprocess metric files get cleaned up. That call was silently dropped three weeks later by the 1.3.0 release commit 8c2b967e7 (PR #3956, 2025-11-16), which wholesale-rewrote livekit/agents/ipc/supervised_proc.py (~350 lines replaced) — apparently from a branch base that predated #3565. No commit in history explicitly removes the call (git log -S mark_process_dead shows only the add), so this looks like an accidental regression rather than a deliberate revert.
It is still absent today on main (41553e109, 2026-08-27) and in the latest release we run, 1.6.10.
First-parent blob walk of ipc/supervised_proc.py shows the block present from 82d5a78cb until 8c2b967e7 (1.3.0), gone from then on. The rest of #3565's wiring survived — worker.py still sets up/wipes PROMETHEUS_MULTIPROC_DIR at startup and telemetry/http_server.py still serves a MultiProcessCollector — only the per-job teardown call was lost.
Impact
On long-lived workers, every completed job process leaves its *_<pid>.db files in PROMETHEUS_MULTIPROC_DIR forever (we observed 175 files / ~40 dead PIDs on a pod). Every /metrics render builds a fresh MultiProcessCollector that globs, mmaps, and parses all of them, so render time grows monotonically until Prometheus scrapes exceed the scrape timeout and the worker's series go absent. Pods stay Ready throughout, so the failure is invisible to Kubernetes health checks. We hit this twice in production (fleet-wide Absent - lk_agents_active_job_count alerts), each time "fixed" by a rolling restart.
Note that mark_process_dead only removes gauge_live*_<pid>.db files — counter_, histogram_, and summary_ files still accumulate even with the call restored. It may be worth extending teardown to unlink all*_<pid>.db suffixes for the dead PID, since the SDK owns the directory contract.
Summary
PR #3565 (commit
82d5a78cb, 2025-10-23) added aprometheus_client.multiprocess.mark_process_dead(self._pid)call inSupervisedProcteardown, so dead job processes' multiprocess metric files get cleaned up. That call was silently dropped three weeks later by the 1.3.0 release commit8c2b967e7(PR #3956, 2025-11-16), which wholesale-rewrotelivekit/agents/ipc/supervised_proc.py(~350 lines replaced) — apparently from a branch base that predated #3565. No commit in history explicitly removes the call (git log -S mark_process_deadshows only the add), so this looks like an accidental regression rather than a deliberate revert.It is still absent today on
main(41553e109, 2026-08-27) and in the latest release we run, 1.6.10.Evidence
First-parent blob walk of
ipc/supervised_proc.pyshows the block present from82d5a78cbuntil8c2b967e7(1.3.0), gone from then on. The rest of #3565's wiring survived —worker.pystill sets up/wipesPROMETHEUS_MULTIPROC_DIRat startup andtelemetry/http_server.pystill serves aMultiProcessCollector— only the per-job teardown call was lost.Impact
On long-lived workers, every completed job process leaves its
*_<pid>.dbfiles inPROMETHEUS_MULTIPROC_DIRforever (we observed 175 files / ~40 dead PIDs on a pod). Every/metricsrender builds a freshMultiProcessCollectorthat globs, mmaps, and parses all of them, so render time grows monotonically until Prometheus scrapes exceed the scrape timeout and the worker's series go absent. Pods stayReadythroughout, so the failure is invisible to Kubernetes health checks. We hit this twice in production (fleet-wideAbsent - lk_agents_active_job_countalerts), each time "fixed" by a rolling restart.Two asks
mark_process_deadcall inSupervisedProcteardown (restore what Configure Prometheus in multi process mode #3565 had).mark_process_deadonly removesgauge_live*_<pid>.dbfiles —counter_,histogram_, andsummary_files still accumulate even with the call restored. It may be worth extending teardown to unlink all*_<pid>.dbsuffixes for the dead PID, since the SDK owns the directory contract.Happy to open a PR for either/both if that helps.