Skip to content

Commit 5427fd2

Browse files
authored
LinuxContainer: stop the VM when setup fails after start (#836)
vm.start() sits outside the do block that owns teardown. This change prevents a failure in the agent setup from orphaning a VM.
1 parent dac8a2c commit 5427fd2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/Containerization/LinuxContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ extension LinuxContainer {
641641
let vm = try await self.vmm.create(config: creationConfig)
642642
let relayManager = UnixSocketRelayManager(vm: vm, log: self.logger)
643643

644-
try await vm.start()
645644
do {
645+
try await vm.start()
646646
let mountsForAgent = containerMounts
647647
try await vm.withAgent { agent in
648648
try await agent.standardSetup()

0 commit comments

Comments
 (0)