gracefulShutdown
gracefulShutdown(
kernel,ns,timeout):Promise<void>
Defined in: packages/runtime/src/platform/boot.ts:1144
Tear down a running kernel with a SIGTERM → grace → SIGKILL sequence.
Parameters
Section titled “Parameters”kernel
Section titled “kernel”Kernel
The kernel returned by createContainerKernel.
The namespace that kernel was built over.
timeout
Section titled “timeout”number
Grace period in milliseconds between SIGTERM and SIGKILL.
Returns
Section titled “Returns”Promise<void>
Remarks
Section titled “Remarks”The canonical shutdown path. Snapshot running pids, SIGTERM all,
race their exit promises against timeout, SIGKILL any survivors,
await every exit promise, then call ns.dispose() (which disconnects
bridge proxies and drops the kernel log). Used by both
UnixInstance.shutdown and the container runtime’s internal
shutdown path.
Caveat
Section titled “Caveat”Not idempotent — ns.dispose() is called unconditionally at the
end, so calling gracefulShutdown twice on the same namespace
will disconnect already-disconnected proxies (harmless today,
but not guaranteed).