File tree Expand file tree Collapse file tree
Sources/Services/ContainerSandboxService/Server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -949,8 +949,8 @@ public actor SandboxService {
949949 metadata: [ " network " : " \( networkId) " ]
950950 )
951951 // Attempt graceful container cleanup under the lock before exiting.
952- await self . lock. withLock { _ in
953- guard let ctrInfo = await self . container else { return }
952+ let shouldCancel = await self . lock. withLock { _ -> Bool in
953+ guard let ctrInfo = await self . container else { return false }
954954 switch await self . state {
955955 case . running, . booted:
956956 await self . setState ( . stopping)
@@ -963,13 +963,16 @@ public actor SandboxService {
963963 )
964964 }
965965 await self . setState ( . stopped)
966+ return true
966967 default:
967- break
968+ return false
968969 }
969970 }
970971 // Cancel the main XPC connection. This causes the XPC server's listen() to return,
971972 // unwinding the task group in RuntimeLinuxHelper and exiting the process.
972- xpc_connection_cancel ( self . connection)
973+ if shouldCancel {
974+ xpc_connection_cancel ( self . connection)
975+ }
973976 }
974977
975978 private func getDefaultNameservers( networkConfigs: [ AttachmentConfiguration] ) async throws -> [ String] {
You can’t perform that action at this time.
0 commit comments