Docker stats subscription stays silent after collector stops; API restart restores events
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- docker, graphql, typescript
- Bereich
- backend-api-design, observability-sre
Rechercherichtung
Start by reading DockerStatsService.startStatsStream and SubscriptionTrackerService, which the issue identifies as the collector lifecycle and subscriber restart paths. Trace clean exit, signal, failure, subscriber reconnection, restart backoff, and intentional stop; check existing tests for these cases. Done means the collector recovers for active subscribers after it exits, while intentional stops leave no orphaned process.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Environment
Unraid OS Version: 7.3.4; API 4.37.7+250d3663
Are you using a reverse proxy? No external reverse proxy. Reproduced directly on the server's IP through its built-in nginx /graphql endpoint.
Pre-submission Checklist
- I have verified that my Unraid OS is up to date
- I have tested this issue by accessing my server directly (not through a reverse proxy)
- This is not an Unraid Connect related issue
Issue Description
The Docker statistics subscription stopped publishing any events on a running server with 12 running containers. HTTP inventory queries still succeeded, the WebSocket returned connection_ack, and subscribing to dockerContainerStats yielded no next/error/complete events. This left downstream Home Assistant CPU/memory aggregate sensors Unknown.
Restarting only the Unraid API service restored the subscription immediately, without restarting Docker, Home Assistant, or any container.
Steps to Reproduce
The original trigger for the collector stopping is not yet known. Once the stalled state exists:
- Verify docker inventory over GraphQL returns running containers.
- Open graphql-transport-ws, send connection_init with the API key, await connection_ack, then subscribe to:
subscription {
dockerContainerStats {
id
cpuPercent
memUsage
memPercent
netIO
blockIO
}
}
- Observe no events for a bounded 12–25 second probe; longer-lived HA subscriptions were also empty.
- On the host, docker stats --no-stream produces valid readings, but there is no long-lived docker stats --format ... --no-trunc process beneath the API process.
- Restart only unraid-api. Repeat step 2: valid events immediately arrive and IDs match inventory.
A deliberately invalid subscription received an immediate validation error, confirming the socket was processing operations rather than silently dropping client frames.
Expected Behavior
The stats collector should recover after its child process exits while subscribers remain active. New consumers should receive readings while Docker is healthy.
Actual Behavior
Existing and new consumers remain connected without stats. Reloading the HA integration alone did not restore the collector. API service restart restored events. All 12 containers retained their uptimes; array remained STARTED with no resync or disk errors.
Additional Context
In DockerStatsService.startStatsStream, statsProcess is treated as an active-process sentinel. Its completion handler clears that sentinel only when result.failed && !result.signal, and its catch branch skips err.killed. A clean exit or signal can therefore leave a non-null process handle after the collector is gone. SubscriptionTrackerService starts topics only on a 0→1 subscriber transition, so collector recovery with existing subscribers also needs consideration.
This lifecycle problem is a source-based hypothesis, not a confirmed original exit cause. Please cover clean exit, signal/kill, failure, subscriber retention/reconnection, restart backoff, and intentional stop without orphaning processes.
This differs from #2007: here no CPU/memory/I/O events arrive at all, rather than only I/O counters freezing.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 123
- Forks
- 25
- Ø Merge
- 2 T. 16 Std.
- Gemergte PRs (30 T.)
- 9
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus unraid/api
-
Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullableOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
tashfeenahmed/freellmapi#2169 ·
Maintainer antworten meist innerhalb von 1 Tag
-
via-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 1 Tag
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
vercel-labs/ui#1563 ·
Maintainer antworten meist innerhalb von 1 Tag