LinuxProcess: Swap from logging in delete (#386)

This changes LinuxProcess to not just log errors but return them.
This commit is contained in:
Danny Canter
2025-11-11 14:42:41 -08:00
committed by GitHub
parent cfe4fd77cb
commit 8a9b0deb82
2 changed files with 17 additions and 13 deletions
@@ -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
+16 -12
View File
@@ -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 {