Work Intent: Fix state file watcher detachment by enabling polling on emhttp state files (#1788)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 123
- Fork
- 25
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của unraid/api
-
Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullableĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
parityHistory query fails with NaN when a parity-checks.log record has an empty errors fieldĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mckinsey/agents-at-scale-ark#4091 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NUS-Project-SaBai/project-sabai#386 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
android needs clarification
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
super-productivity/super-productivity#12105 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày