fix: never warn from best-effort systemd probes#7
Merged
Conversation
The systemctl/loginctl status probes used execFileSync with stderr ignored, so the earlier isSystemdUnavailable() check inspected an empty stderr / a generic "Command failed" message, never matched, and fell through to logger.warn — still dumping a stack trace to stderr on machines without a systemd user session (`dial doctor`, `dial wait-for`). A best-effort status/linger probe failing — systemctl missing, no user session bus (sandbox/container/CI), unit unknown — just means "not running". Log any such failure at debug (suppressed by default; DIAL_LOG_LEVEL=debug to see it), never warn. Removed the ineffective detector. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Follow-up to #6, which didn't actually silence the noise.
Why #6 missed it
systemctlStatus()/lingerEnabled()callexecFileSyncwith stderr ignored (stdio: ["ignore","pipe","ignore"]). So theisSystemdUnavailable(err)check added in #6 inspected an emptyerr.stderrand a generic"Command failed: systemctl …"message — its regex never matched — and execution fell through tologger.warn({ err }, …), still dumping a full error/stack trace to stderr on machines without a systemd user session.dial doctoranddial wait-forkept leaking it.Fix
A best-effort status/linger probe failing — systemctl not on PATH, no user session bus (sandbox/container/CI), unit unknown — simply means "not running" for our purposes. Log any such failure at
debug(suppressed by default;DIAL_LOG_LEVEL=debugto inspect), neverwarn. Removed the ineffectiveisSystemdUnavailabledetector. Install/uninstall actions still surface real errors (they throw, unchanged).Version
0.13.1→0.13.2.Verification
npm run buildclean;npm test— 51 pass / 0 fail.🤖 Generated with Claude Code