Repository navigation
fix: retain ENIs when orphan cleanup fails - #32
Merged
Merged
Conversation
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.
When Volcengine creates an ENI, a temporary API outage can make both attachment and the bounded compensating delete fail. The unattached ID was then discarded. Subsequent init only discovers attached ENIs, and teardown cannot recover an ID that never reached
pool.json.Return the created ID in the partial result when its compensating delete fails. A failed delete now returns an error before IP allocation, so the existing init failure path persists the owned ID. Successful provisioning also merges previously recorded IDs, preserving that cleanup responsibility across retries. Existing teardown can then delete the detached ENI by ID; this change does not add background collection or promise cleanup during successful init.
The discard-on-compensation-failure path dates to 520516e. #8 added attached-ENI reuse and cancellation cleanup; #12 added persisted-ID teardown; #28 preserved partial attachment results. Those paths still lost an unattached ID when compensation itself failed.
Validation:
vefixture: attach/delete failure, ownership persisted without IP allocation, then successful provisioning retaining previous IDs. The deliberately invalid primary NIC stops before host networking changes.make testpasses with race detection and coverage on macOS. Missing-ID query behavior was cross-checked against the official provider's ID-filtered read.Production diff: +4 lines. No DHCP/claim-path change, new cloud call, timer, background worker or persistent format. Only init adds a merge into the existing cleanup ID list.