mirror of
https://github.com/apple/container.git
synced 2026-09-16 04:35:38 +00:00
LinuxProcess: Swap from logging in delete (#386)
This changes LinuxProcess to not just log errors but return them.
This commit is contained in:
@@ -566,7 +566,7 @@ extension LinuxContainer {
|
||||
}
|
||||
|
||||
// Lets free up the init procs resources, as this includes the open agent conn.
|
||||
try? await startedState.process.delete()
|
||||
try await startedState.process.delete()
|
||||
|
||||
try await startedState.vm.stop()
|
||||
state = .stopped
|
||||
|
||||
@@ -399,12 +399,16 @@ extension LinuxProcess {
|
||||
containerID: self.owningContainer
|
||||
)
|
||||
} catch {
|
||||
self.logger?.error(
|
||||
"process deletion",
|
||||
metadata: [
|
||||
"id": "\(self.id)",
|
||||
"error": "\(error)",
|
||||
])
|
||||
self.state.withLock {
|
||||
$0.stdinRelay?.cancel()
|
||||
try? $0.stdio.close()
|
||||
}
|
||||
try? await self.agent.close()
|
||||
throw ContainerizationError(
|
||||
.internalError,
|
||||
message: "failed to delete process",
|
||||
cause: error,
|
||||
)
|
||||
}
|
||||
|
||||
do {
|
||||
@@ -413,12 +417,12 @@ extension LinuxProcess {
|
||||
try $0.stdio.close()
|
||||
}
|
||||
} catch {
|
||||
self.logger?.error(
|
||||
"closing process stdio",
|
||||
metadata: [
|
||||
"id": "\(self.id)",
|
||||
"error": "\(error)",
|
||||
])
|
||||
try? await self.agent.close()
|
||||
throw ContainerizationError(
|
||||
.internalError,
|
||||
message: "failed to close stdio",
|
||||
cause: error,
|
||||
)
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user