Repository navigation
Conversation
…eck off (t8y2#995, t8y2#986) - remotestats: df -Pk -l hid NFS/SMB/CIFS volumes from the disk monitor on Linux hosts. Enumerate with df -Pk so network data volumes appear, bound it with timeout(2) when available so one stale mount cannot stall the sample, and add regression tests (t8y2#995). - workbench: the automatic update check defaulted to on while README and the website promi 10BC8 se it is off ("Nothing phones home"). Read the saved value as on only when explicitly set, in both the startup toggle and the diagnostics report, and update the tests (t8y2#986).
There was a problem hiding this comment.
Thanks for the NFS/SMB work. Two things need to change before this merges:
- The stale-mount problem (internal/remotestats/details.go:149):
timeout 2 df -Pkcannot end adfblocked on a hung NFS/CIFS mount. The 4s deadline then drops the whole details sample every refresh, and each sample leaves a stuckdfon the host. Please enumerate mounts from /proc/self/mountinfo without I/O, and keep statfs of network mounts out of the main sample (its own cadence, or skip a mount whose last probe hung). - Please drop the change of the automatic update check default to off. That default is not accepted; the rest of this PR can stay.
Also, TestDetailsKeepsANetworkMount feeds a fixture into parseDetails and passes even with -l in place, so it does not guard this behavior. A Linux test that runs detailsCommand with a fake df on PATH would.
There was a problem hiding this comment.
Thanks for the fix, and the update-check default matches the README. One blocker in the disk monitor change (internal/remotestats/details.go:148): GNU df builds its whole table before printing, so when timeout 2 kills df -Pk on a stale NFS/CIFS mount nothing reaches awk and the monitor loses every disk, local ones included. Before this change -l kept the local disks working. The comment and the PR text saying already-emitted lines are still parsed do not hold.
Please keep df -Pk -l for local disks and add a separate bounded call for network types (timeout 2 df -Pk -t nfs -t nfs4 -t cifs -t smb3 …), merging the rows, so a hung mount only costs the network rows. Please also check older busybox, where timeout 2 may be rejected and the disk list would silently be empty. The tests that assert substrings of the shell script would not catch this; test the merge/parse behaviour instead.
Also, the default-off change only applies to profiles with no saved update_check (persist.go:614 always writes on/off), so existing users stay on; the PR text says otherwise.
There was a problem hiding this comment.
Thanks for the fix! A few things need to change before this can merge:
timeout 2 df -Pkdoes not keep the already-printed rows parseable: coreutilsdfstats every mount first and prints the table at the end, so one unreachable NFS mount makes the whole sample lose all disks (including/). With a hard mount, SIGTERM may not even killdf(usetimeout -k). A sturdier approach isdf -lfor local disks so they always show up, then query network mounts (by fstype from/proc/mounts) one at a time, each with its own timeout. Older BusyBox also needstimeout -t 2, otherwise the disk list vanishes entirely there (internal/remotestats/details.go:148).- The two new tests don't cover the real path: one only does
strings.Containson the command, the other feeds an already-processeddiskline straight toparseDetailsand skips awk. Please test the awk script with realdf -Poutput, including mount points and SMB sources with spaces (//nas/my share). Alsolen(d.Disks) >= 64truncates before sorting, so with-lgone NFS volumes can be crowded out by overlay/squashfs entries (details.go:226). - Defaulting update checks to off reverses the deliberate default-on decision in bb3524e, so it needs a maintainer call. Also, users who have saved settings already store
"on", so this only affects fresh configs, which differs from the description. Please split it into its own PR with the migration impact spelled out.
The branch also conflicts with main now, so it needs a rebase.
There was a problem hiding this comment.
Thanks for the contribution. There are two things to deal with, and the update check half should come out of this PR.
internal/remotestats/details.go:148: with-lremoved,timeout 2 df -Pk | awkloses the whole disk list when one network mount hangs. coreutilsdfstats every mount before it prints anything, so whentimeoutkills it nothing has been written, and local disks disappear too. That is worse than before, when-lskipped network mounts.timeoutalso has no-k, so a process stuck in D state may survive. Please keepdf -Pk -lso local disks always show, add the network filesystems with a separate bounded call (timeout -k 1 2 df -Pk -t nfs -t nfs4 -t cifs -t smb3), and fall back to-lalone wheretimeoutis missing (BusyBox, macOS, BSD). A test with a fakedfthat hangs, asserting the local disks still come out within the timeout, would cover it better than the current string checks.internal/workbench/sftp_extra.go:593: please drop the update check default change from this PR. Automatic checking was made default-on on purpose in bb3524e (an emptyupdate_checkmeans on), and we are keeping that. The README and website saying "off" are out of date and we will fix those ourselves.
The branch also conflicts with main (details_test.go, sftp_extra.go); please rebase after the above.
There was a problem hiding this comment.
Requesting changes. The earlier review points still apply to the current head.
-
timeout 2 df -Pk | awk(details.go:148-150) loses the whole disk table when one NFS/CIFS mount hangs: coreutilsdfstats every mount before printing, so killing it bytimeoutyields no output at all,/included, and each sample leaves a stuckdfbehind. BusyBox needstimeout -t 2, otherwise the list is empty. The "rows already printed are still parsed" claim does not hold. Keepdf -Pk -l, fetch network mounts separately withtimeout -k 1 2 df -Pk -t nfs -t nfs4 -t cifs -t smb3and merge, or enumerate from/proc/self/mountinfo. -
Switching the update check default to off (
sftp_extra.go:593,diagnostics.go:144) was already declined by the maintainer (bb3524e keeps it on deliberately). Please drop it from this PR. -
TestDetailsKeepsANetworkMountfeeds an already processeddiskline toparseDetails, so it passes with-lstill in place. Put a fakedf(including one that hangs) onPATHand assert the local disks still appear in time, using realdf -Poutput with spaces in mount points and//nas/my sharefor the awk. -
The
len(d.Disks) >= 64truncation happens before sorting, so overlay/squashfs entries may push NFS volumes out once-lis gone.
The branch also conflicts with main (details_test.go, sftp_extra.go); please rebase.
Summary
Two self-contained bug fixes, each with regression tests. Both are pure Go logic (no UI/platform dependency) and were verified against a local build.
#995 - disk monitor hid NFS/SMB network volumes
The Linux remote probe enumerated disks with df -Pk -l. The -l/--local flag excludes every network filesystem (nfs/nfs4/cifs/smb), so NAS data volumes such as /data1-/data5 never reached the monitor, while virtual mounts filled the list.
Files: internal/remotestats/details.go, internal/remotestats/details_test.go
#986 - automatic update check defaulted on while docs promise off
README (en/zh/ja) and the website state the update check is off by default, but the code read UpdateCheck != "off", so an empty/absent value (update_check,omitempty) counted as on - including for users upgrading who never opted in.
estoreSFTPSettings) and the diagnostics report.
Files: internal/workbench/sftp_extra.go, internal/workbench/diagnostics.go, internal/workbench/launch_test.go
Note: #986 also mentions the update endpoint hitting dl.motty.page before GitHub Releases. That is a deliberate mirror/architecture choice and is left unchanged; this PR only aligns the default on/off behaviour with the documented promise.
Testing
(The full ~3200-test internal/workbench package exceeds the default 10-minute Go test timeout on a local Windows/sqlite machine; recommendation is to let CI run the complete suite.)