Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Work Intent: Stop the temperature metrics query from spinning up array disks (#2017)

未关闭
#2,090 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@elibosley 已经在做这个了。

开始于 2026年9月23日。

评估

这个 Issue 还没有评估数据。

描述

Overview

Fix #2017. Reading disk temperatures through the metrics { temperature } query wakes every spun-down array disk. On my server (Unraid 7.3, five HDDs in the array) one request took about 50 seconds and spun up all five disks. Anything that polls temperatures, including the systemMetricsTemperature subscription, keeps the array from ever staying spun down.

The cause: DiskSensorsService.read() gets its disk list from DisksService.getDisks(), which calls diskLayout() from systeminformation. On Linux, diskLayout() runs smartctl -a -j and smartctl -H on every disk without -n standby, and that wakes them. The temperature read itself (getTemperature()) already uses smartctl -n standby, so the disk listing is the only part that wakes the disks.

To confirm the cause before asking, I tried a small local prototype and measured both paths on my server with the disks spun down:

Current (diskLayout()) Proposed (lsblk)
Time ~50,700 ms ~70 ms
Disks spun up 5 of 5 0 of 5

Technical Approach

  • Add DisksService.getPhysicalDisks(), which lists disks with lsblk -J -d -b -o PATH,TYPE,SIZE,SERIAL,MODEL,TRAN. lsblk only reads kernel metadata and never touches the disk.
  • It returns the same id (serial), device, name (model) and interfaceType that the temperature code uses today, so sensor IDs and names don't change. It keeps whole disks with a non-zero size and skips loop/ram devices, which matched what diskLayout() returned on my server.
  • Switch DiskSensorsService.read() to use it. Spun-down disks are then skipped by the existing smartctl -n standby check, as they are today, instead of being woken.
  • Move the interface-type mapping in parseDisk() into a small shared helper so both paths map it the same way.
  • Tests: unit tests for getPhysicalDisks() (parsing, filtering, no SMART calls), and a sensor test that read() no longer calls getDisks().

Out of scope: getDisks() (the disks query) has the same wake-up behavior through diskLayout(). I'd keep this change small and raise that separately if you want it fixed too.

Scope

  • API
  • Plugin
  • Web UI
  • Build/Deploy Process
  • Documentation

Timeline & Impact

  • Estimated time needed: a few days, since the prototype and tests already exist.
  • Potential impacts: temperature readings only. Spun-down disks won't report a temperature, as with the current -n standby behavior. No schema changes.

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
主要语言
TypeScript
星标
113
派生
23
平均合并
1 天 21 小时
30 天内合并 PR
12

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

unraid/api 的其他 Issue

查看 unraid/api 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。