Fix: disks never reach standby on 25.10.4/25.10.5 - temp() guard never fires - #7
Open
kienxux wants to merge 1 commit into
Open
Fix: disks never reach standby on 25.10.4/25.10.5 - temp() guard never fires#7kienxux wants to merge 1 commit into
kienxux wants to merge 1 commit into
Conversation
…issing On 25.10.4/25.10.5 the standby_disks state file is absent at runtime, so the existing guard in temp() never fires and temp1_input is read on every poll. Each read issues a command to the disk and restarts its idle timer, so rotational disks never reach standby - the patch silently degrades to stock behaviour. Adds a FileNotFoundError fallback that skips temperature reads for rotational disks. SSD/NVMe temperatures and the existing standby_disks path are unchanged. Tested on 25.10.5, kernel 6.12.95, four SATA HDDs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6, and likely #4.
Symptom
On TrueNAS 25.10.5 the v25 patch applies cleanly and the overlay mounts correctly, but the disks never spin down. Everything normally checked looks right:
The middleware is genuinely running the patched module. The disks still stay awake indefinitely.
Root cause
The tell is
disk.temperatures:Real values, with the patch applied — so
DiskEntry.temp()is still reaching thetemp1_inputsysfs read. TrueNAS's own comment on that method explains why it matters:Each poll issues a command to the disk and restarts its idle timer, so a rotational disk never accumulates enough idle time to enter standby. The
-n standbyguard onsmartctlis then irrelevant, because it only helps once a disk has already reached standby — which never happens.The existing guard in
temp()depends on{MIDDLEWARE_RUN_DIR}/standby_disks, written byplugins/disk.pyduringdisk.power_management. When that file is not present at runtime the bareexcept: passswallows the failure and execution falls through to the sysfs read. The patch then silently degrades to stock behaviour — which matches #6 exactly: patch applied,grep 360confirms it, disks still awake.Change
Adds a
FileNotFoundErrorfallback insidetemp(): if thestandby_disksstate file is missing, skip temperature reads for rotational disks (queue/rotational == 1). SSD and NVMe temperatures are unaffected, and the existingstandby_disksbehaviour is preserved when the file is present.queue/rotationalis read from sysfs and issues no command to the disk, so the check itself cannot wake anything.Testing
TrueNAS 25.10.5, kernel 6.12.95, four SATA HDDs (Seagate ST4000NM000B, ST4000NE001, ST4000VN006), HDD Standby 10 min, APM 128, system dataset on an SSD pool.
Verified with
temp()overridden for rotational disks — the configuration that was working on 25.10.0:Stable across a reboot (Pre Init mount + delayed middlewared restart) and over a 15-hour idle period.
Two notes for others hitting this
ACTIVE/IDLEfor the first N minutes after amiddlewaredrestart. Wait past the standby timeout before concluding the patch failed — this cost me a day of chasing the wrong thing.powertoptunables: SATA link power management reverts toBadon every boot, and powertop settings do not survive a boot-environment change. Unrelated to this patch, but it looks identical from the wall meter.