chore(deps): adopt dig-logging 0.2.0 - #237
Draft
MichaelTaylor3d wants to merge 3 commits into
Draft
Conversation
An unwritable log directory no longer costs the whole subscriber: dig-logging 0.2.0 degrades to console-only logging and reports the reason via LogGuard::file_error(). Surface that on control.status so an operator can tell a node that is logging to disk from one that is only speaking on the console. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <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.
DO NOT MERGE — gate round not yet run
What
Adopts
dig-logging0.2.0 indig-nodeand uses the signal it adds.Under 0.1.4
dig_logging::initwas all-or-nothing: when the file appender could not be built itreturned
Errand the stderr layer was never installed either, so the process ran with notracing subscriber at all. On this user's machine an interactive
dig-node run, on a host whereC:\ProgramData\DigNetwork\logs\dig-nodebelongs to the service account, was therefore completelysilent — which made a broken profile-sync subsystem read as dead rather than broken.
0.2.0 degrades to console-only logging and reports the reason via
LogGuard::file_error().crates/dig-node-service/Cargo.toml:dig-logging = "0.2";Cargo.lockmoves exactly one entry(
dig-logging 0.1.4 -> 0.2.0,cargo update -p dig-logging; no other pin moved).logging.rs: newfile_error(),log_dir(),initialized(), and a purehealth().control.rs:control.statusgains aloggingobject (initialized,dir,file_logging,file_error). This is the surface where the node reports its own health, so it is where adegraded sink is reported; no new control method, so no CLI-parity drift.
SPEC.md§20.1 + thecontrol.statusresult row updated in the same unit of work.The fatal branch at
logging.rs:71— kept, deliberatelyThe
Errarm was NOT removed. Its unwritable-dir case is now dead, but the arm is still reachablefor
AlreadyInitialized(a second subscriber in one process), which is a real condition in tests andin any future embed. Deleting it would swap a warning for a silent no-op. It is retained with its
doc-comment rewritten to say exactly which conditions still reach it, and the message corrected from
"continuing without a log file" (which is now wrong — the failure costs the whole subscriber, not
the file) to "continuing without a subscriber".
Verification
crates/dig-node-service/tests/logging_degraded.rs— an integration test owning its own process(the subscriber and the
OnceLockguard are process-global, so the degraded state can beestablished exactly once). It points
DIG_LOG_DIRat a path whose parent is a regular file, socreate_dir_allcannot succeed on any platform — the fixture does not depend on being unprivileged,on ACLs, or on a read-only mount, the three things that make a permission fixture pass for the wrong
reason (or, under an elevated runner, not fail at all).
It asserts both halves of the load-bearing property:
LevelFilter::current() != OFF(a subscriber ISinstalled, i.e. stderr logging is live) and
file_error().is_some()(the node knows the file sink isoff), plus that
health()reportsfile_logging: false.Revert-proof: with
logging::initpatched to mimic 0.1.x's all-or-nothing failure, the test FAILS atinit must succeed and hold a guard even when the file sink cannot be opened. Pinning the dep backto
=0.1.4instead fails to compile (no method named file_error), which is why the behaviouralsimulation was used for the proof. Needle presence was asserted before each patch and the file
restored from
gitafterwards.Unit tests cover both
health()arms plus the never-initialised arm, so neither atruenor afalseconstant survives.Blast radius
gitnexus is per-worktree and was not indexed for this lane (a fresh
analyzehere exceeds the 10-minstop for a change this size), so blast radius was established by ripgrep + direct read, per §2.0
bound 2:
dig_logging::inithas exactly one caller in this repo:logging::init(
crates/dig-node-service/src/logging.rs), itself called only from the serve entrypoints(
entrypoint.rs:866, the unix daemon, the Windows service body).Error::LogDir/Error::Appender, the two removed variants — grepreturns nothing — so the removal breaks no caller.
status()is the only changed control handler; its result is additive.CONTROL_METHODS/OWNED_CONTROL_METHODSare untouched, andcontrol_contract_conformancepasses (5/5).Risk: LOW. No custody, crypto, wire-format or peer-facing surface is touched.
Not watched working on a real machine
The silent-node scenario itself has only been reproduced in-process via
DIG_LOG_DIR. Nobody has runan installed
dig-nodeon a host whose machine log dir is service-account-owned and watched it narrateon the console; and no one has read the new
loggingblock out of a livecontrol.status.Tests
cargo test -p dig-node-service: all targets green (355 lib + every integration target).cargo fmt --all,cargo clippy -p dig-node-service --all-targets -- -D warnings: clean.Version: workspace
0.124.1 -> 0.125.0(minor — additivecontrol.statusfield + new publicloggingAPI).