Work Intent: Fix state file watcher detachment by enabling polling on emhttp state files (#1788)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 32/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- backend
Rechercherichtung
Do not start until a core developer removes the unapproved label. Once approved, read the file watcher setup in api/src/store/watch/state-watch.ts and the command client in api/src/core/utils/clients/emcmd.ts, then reproduce the stale var.ini state after an atomic replacement. Done means array state and parity check status stay current across replacements, with regression tests added.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Overview
Resolves #1788 and eliminates desynchronization of array and parity check states in the GraphQL API.
In Unraid OS, emhttpd maintains live status files (such as /var/local/emhttp/var.ini) by writing to temporary files (*.ini.new) and atomically renaming them over the active state file. When unraid-api watches var.ini via inotify (usePolling: false), atomic file replacements detach the inotify watch from the unlinked inode. Once detached, the in-memory Redux store permanently ceases updating until the API daemon is restarted, causing array.state and array.parityCheckStatus queries to return stale snapshots indefinitely.
Technical Approach
- In
api/src/store/watch/state-watch.ts, configure Chokidar to use path-based polling (usePolling: true) across emhttp state files (1s interval for dynamic files likevar.ini, 10s interval for list collections likedisksandshares). - In
api/src/core/utils/clients/emcmd.ts, trigger an immediate reload ofStateFileKey.varupon successful command execution so callers reading state immediately receive the new state without polling latency. - Add regression tests validating state reload consistency across atomic file replacements.
Scope
- API
- Plugin
- Web UI
- Build/Deploy Process
- Documentation
Timeline & Impact
- Estimated time needed: 1–2 days
- Potential impacts: Eliminates stale array and parity states in the GraphQL API; minimal CPU overhead (single-path
statpolling at 1s interval).
Pre-submission Checklist
- I have searched for similar work/issues
- I understand this needs approval before starting
- I am willing to make adjustments based on feedback
- 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
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
mckinsey/agents-at-scale-ark#4091 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
factory:subtask
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
NUS-Project-SaBai/project-sabai#386 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
android needs clarification
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
super-productivity/super-productivity#12105 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag