Propagate saveClassID error and clear stale classid files#180
Merged
sjmiller609 merged 1 commit intomainfrom Mar 31, 2026
Merged
Propagate saveClassID error and clear stale classid files#180sjmiller609 merged 1 commit intomainfrom
sjmiller609 merged 1 commit intomainfrom
Conversation
saveClassID now returns an error instead of discarding it, so a failed write (e.g. disk full) surfaces immediately rather than silently losing the collision-resolved class ID. When no upload rate limiting is applied (classID empty), any stale classid file from a previous allocation is removed to prevent removeVMClass from targeting a wrong class.
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
Follow-up to #179. Addresses two review comments on the tc class collision fix:
saveClassID now returns error instead of discarding it with
_ =. If the write fails (e.g. disk full), the error surfaces immediately rather than silently losing the collision-resolved class ID — which would causeremoveVMClassto fall back toderiveClassIDand target the wrong class.Stale classid files are cleared when no upload rate limiting is applied (
classIDis empty). Previously, if an instance was recreated without rate limiting, the oldclassidfile persisted, causingReleaseAllocationto delete the wrong tc class.Changes
lib/network/allocate.go—saveClassIDreturnserror; callers propagate it; newclearClassIDhelper; bothCreateAllocationandRecreateAllocationclear stale files whenclassIDis empty.Note
Medium Risk
Touches network allocation/restore paths by changing
saveClassIDto fail fast on disk write errors and by deleting persisted class IDs when no rate limiting is applied, which could surface new allocation failures and affects tc class cleanup behavior.Overview
Improves tc class ID persistence during network allocation/restore by making
saveClassIDreturn an error and propagating failures fromCreateAllocation/RecreateAllocationinstead of silently ignoring write issues.Also clears any existing
classidfile whencreateTAPDevicereturns an empty class ID (no rate limiting), preventing stale persisted IDs from causing incorrect tc class deletion on release.Written by Cursor Bugbot for commit b0ec2e4. This will update automatically on new commits. Configure here.