Sweep leaked test networks at job start - #475
Open
Sayan- wants to merge 2 commits into
Open
Conversation
Tests create a bridge and route per VM and clean up on success, but runs that die mid-test leak them, and cancel-in-progress made mid-test death routine. The pile eventually collides with test subnets and every run fails on SUBNET CONFLICT, which has taken the fleet red twice in eight days. Each job now deletes interfaces that are DOWN with no attached ports across two snapshots, skipping the settle delay when the host is healthy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sayan-
marked this pull request as ready for review
September 3, 2026 17:36
Sayan-
force-pushed
the
hypeship/ci-network-janitor
branch
from
September 3, 2026 17:36
73e44ac to
71e580c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 71e580c. Configure here.
Bugbot caught a real hole in the double-snapshot design: a live bridge sits DOWN with no ports from Initialize until the TAP attaches after the rootfs build, which can exceed any settle window, so under enough concurrency the sweep could delete live bridges. Age discriminates where liveness cannot: a live bridge waits at most one go-test timeout for its TAP, while leaks are hours old. Sweep only interfaces older than an hour, read from the sysfs dir timestamp, sparing anything whose age cannot be read. This also deletes the snapshot, sleep, and threshold machinery outright. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sjmiller609
approved these changes
Sep 3, 2026
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.

Summary
Runs that die mid-test (crash, timeout, cancellation) leak their bridge and route, and the pile eventually collides with test subnets, which took the fleet fully red on Aug 26 and Sep 3. Each job now sweeps before it starts: interfaces matching hypeman's naming that are DOWN, portless, and older than 1h are deleted (a live bridge waits at most one 20m go-test timeout for its TAP, leaks are hours old; unreadable age spares the interface, and the step never fails the job).
Testing
CI