Skip to content

[shimV2] order container teardown so the UVM can reap bundle dirs#2737

Merged
rawahars merged 1 commit into
microsoft:mainfrom
rawahars:v2_bug_delete_task
May 13, 2026
Merged

[shimV2] order container teardown so the UVM can reap bundle dirs#2737
rawahars merged 1 commit into
microsoft:mainfrom
rawahars:v2_bug_delete_task

Conversation

@rawahars
Copy link
Copy Markdown
Contributor

Summary

  • Deleting an LCOW container no longer leaves the bundle/scratch parent pod dir (/run/gcs/pods/) inside the UVM.
  • KillProcess fans the signal out to every exec when the caller asks for "all" or passes an empty execID, matching the "kill the whole container" path used by delete.

Theme: re-sequence host- and guest-side teardown around DeleteContainerState.

internal/controller/linuxcontainer:

  • Relocate the DeleteContainerState GCS RPC from closeContainer() to the tail of releaseResources(), so it runs after the combined-layer overlay, SCSI mounts, and VPCI devices are released. Issuing it earlier left the overlay mounted over the bundle root, which blocked the GCS from removing it.
  • Gate the RPC behind a new isContainerStateDeleted flag.
  • closeContainer() now only closes the container handle and terminatedCh.

@rawahars rawahars requested a review from a team as a code owner May 13, 2026 14:19
@rawahars rawahars force-pushed the v2_bug_delete_task branch from 3648f26 to 090ed43 Compare May 13, 2026 15:08
Comment thread internal/guest/runtime/hcsv2/container.go
Comment thread internal/controller/linuxcontainer/container.go
Comment thread internal/controller/linuxcontainer/container.go
* Deleting an LCOW container no longer leaves the bundle/scratch parent pod dir
  (/run/gcs/pods/<podID>) inside the UVM.
* KillProcess fans the signal out to every exec when the caller asks
  for "all" or passes an empty execID, matching the "kill the whole
  container" path used by delete.

Theme: re-sequence host- and guest-side teardown around
DeleteContainerState.

internal/controller/linuxcontainer:
- Relocate the DeleteContainerState GCS RPC from closeContainer() to
  the tail of releaseResources(), so it runs after the combined-layer
  overlay, SCSI mounts, and VPCI devices are released. Issuing it
  earlier left the overlay mounted over the bundle root, which
  blocked the GCS from removing it.
- Gate the RPC behind a new isContainerStateDeleted flag.
- closeContainer() now only closes the container handle and
  terminatedCh.

Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
@rawahars rawahars force-pushed the v2_bug_delete_task branch from 090ed43 to d051c78 Compare May 13, 2026 17:25
@rawahars rawahars merged commit 4df7d37 into microsoft:main May 13, 2026
28 of 33 checks passed
@rawahars rawahars deleted the v2_bug_delete_task branch May 13, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants