Work Intent: Fix state file watcher detachment by enabling polling on emhttp state files (#1788)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 32/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- typescript
- Domaine
- backend
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- TypeScript
- Étoiles
- 123
- Forks
- 25
- Merge moyen
- 2 j 16 h
- PR mergées (30 j)
- 9
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de unraid/api
-
Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullableOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
parityHistory query fails with NaN when a parity-checks.log record has an empty errors fieldOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de unraid/api
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
mckinsey/agents-at-scale-ark#4091 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
factory:subtask
Difficulté 1/5 Moins d'une heure Accessibilité débutants 94/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
NUS-Project-SaBai/project-sabai#386 ·
Les mainteneurs répondent en général sous 3 jours
-
android needs clarification
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
super-productivity/super-productivity#12105 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour