fix(daemon): choose iface once, then only watch the link - #7
Merged
Conversation
Stop the ~96s microinit restart loop. Drop periodic DHCP recheck, yield-to-client, ProbePolicy, and the carrier-loss watchdog. After apply, micronet holds the chosen interface. Unplug waits linkRetrySecs (default 15) then one full re-select. Health lives on the daemon (self-heal dnsmasq/dhclient, 3-tick hysteresis); micronet check reads IPC instead of probing live. Do not admin-up ifaces that already have carrier; skip ethtool when the link is already up; keep gateway.ip if already assigned. Co-authored-by: Cursor <cursoragent@cursor.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.
Stops the ~96s
networkrestart loop by cutting concurrent decision loops down to one state machine.After apply, micronet holds the chosen interface and mode. It no longer re-probes DHCP every 15s, yields to client, or re-applies on carrier blips. Unplug waits
linkRetrySecs(JSON, default 15) then one full re-select. JSON reload /reconfigurealso re-select.Health is owned by the daemon:
micronet checkreads IPChealthy. No carrier is healthy. Missing dnsmasq/dhclient is restarted in place. Unhealthy only after 3 failed ticks (~9s), with the reason inmicroinit logs network.Apply no longer admin-ups ifaces that already have carrier, skips ethtool when the link is already up, and keeps
gateway.ipif already assigned.Trade-off: a foreign DHCP server that appears without a link break is not detected until the next select (start, unplug longer than
linkRetrySecs, orreconfigure). Power the router first, or unplug/replug the hub cable after it is up.cargo test -p micronetandcargo clippy --all-targets -- -D warningspass locally.