Skip to content

a cancel during the attach-propagation wait drops attached ENIs from the result and from pool.json #25

Description

@CMGS

Problem

In ensureENIs (platform/volcengine/eni.go) result = append(result, ...) happens after sleepCtx(ctx, attachPropagationDelay), so a cancel inside that window returns a result that omits the ENI just attached; ProvisionNetwork (provision.go:41-43) then discards result entirely on error.

Scenario: SIGTERM during init lands in the propagation wait. Up to seven ENIs are attached to the instance, runInit never reaches state.Save, and the seed pool.json has an empty eniIDs. A later teardown sees len(eniIDs) == 0 and falls back to listENIs(instanceID), which is every non-primary ENI on the instance, including any the operator attached for an unrelated purpose.

The round PR fixes the sibling problem (the orphan delete on a detached context and stopping the create loop on cancel); this one changes what init persists on failure and is therefore a decision.

Proposal

Append to result immediately after a successful attach, before the propagation sleep, and have ProvisionNetwork persist whatever ensureENIs returns even on error.

Acceptance

A cancel during the propagation wait leaves pool.json listing every ENI that was attached, and the following teardown detaches exactly those.

Found in the 2026-09-21 whole-repo review round (branch review/whole-repo-2026-09-21). Filed as a behaviour question for the owner; no code change is included in the round PR.

Activity

  1. CMGS commented on Sep 21, 2026

    @CMGS
    ContributorAuthor

    Fixed on the round branch (PR #28, commit 8daca2d): the ENI is recorded before the propagation wait, ProvisionNetwork returns the attached ids with its error, and init persists them before failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions