Quiet the log: expected states stop reporting as failures #163
Loading…
Reference in a new issue
No description provided.
Delete branch "log-noise"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
After #159 cleaned up the import path, the remaining log noise made every service start, network change and settings apply read like a failure (#160, #161, #162): an
ip -6 route replace default via Nonethat can only fail on a v6-less network, WARNING batches from teardown deleting rules that were never added, and three normal startup states (a vanished caller's polkit check, QtWebEngine's deliberate absence, unwritten json files) logged at ERROR/WARNING.Fix
One commit per issue:
create_cgroupskips the v6 route when the routes dict carriesNonefor the gateway; the fwmark rule still lands, pointing at a table with no route, which is where v6 traffic on such a network already ended up.add_rulenow probes deletions with-Cthe same way it already probed inserts: an absent rule skips quietly at debug, deletions by index stay unprobed (-Ctakes a rule spec, not a position). Also fixes the warning reporting the probe's exception instead of the apply's own.NameHasNoOwnernames the subject, not polkit; QtWebEngine absence drops to info naming what degrades (the location map);load_jsontreats a missing file as the first-run default at debug, keeping the warning for files that exist but don't parse.Verification
pytestgreen (369 passed) plus the ruff/compileall gates.TestBypassRoutes(no v6 gateway → no v6 route command, v4 route and both fwmark rules untouched), newtests/test_firewall.py(probe-before-act for deletions/inserts/positional/flush, real failures still warn),TestRequireAuthorization(vanished caller quiet, unreachable polkit loud),TestLoadJson(missing quiet, corrupt warns).Closes #160
Closes #161
Closes #162
🤖 Generated with Claude Code