mirror of
https://github.com/apple/container.git
synced 2026-08-24 10:05:43 -05:00
Log the graceful-stop error instead of silently discarding it in gracefulStopContainer (#1782)
- Closes #1756. - `RuntimeService.gracefulStopContainer(_:signal:timeout:)` wraps the graceful-stop attempt in `do { … } catch {}`. The empty catch silently discards any thrown error before falling through to the unconditional `lc.stop()`. It is the only catch in this file that does not log; every other one uses `self.log.error(…, metadata: ["error": "\(error)"])`. - This adds a single log line matching that convention, so a failed graceful stop (and the resulting fall-through to a forced VM shutdown) is more diagnosable. The intentional fall-through to `lc.stop()` is unchanged.
This commit is contained in:
@@ -1242,7 +1242,9 @@ public actor RuntimeService {
|
||||
|
||||
return code
|
||||
}
|
||||
} catch {}
|
||||
} catch {
|
||||
self.log.error("graceful stop failed; forcing vm shutdown", metadata: ["error": "\(error)"])
|
||||
}
|
||||
|
||||
// Now actually bring down the vm.
|
||||
try await lc.stop()
|
||||
|
||||
Reference in New Issue
Block a user