Skip to content

Commit 69ea4bd

Browse files
ayushr2gvisor-bot
authored andcommitted
Cleanup dev gofer connection if gofer exits but container is still running.
This is helpful in a scenario where: - The container application is a GPU application. - The container application exits. Its mount namespace is released, and as a result all gofer mounts are released. So all gofer connections are closed, except the device gofer connection which is not associated with any mount. - The gofer process continues to hang waiting for the device gofer connection to exit. Before this change, the device gofer connection was only cleaned upon container destruction (e.g. via `runsc delete`). After this change, the gofer process is cleaned up without an explicit `runsc delete`. The gofer monitor is tracking the rootfs mount's gofer connection. When the application exits, it is notified that the connection is closed. We can use this signal to clean up the device gofer connection too. Updates #10997 PiperOrigin-RevId: 683307750
1 parent cbbd0b4 commit 69ea4bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

runsc/boot/loader.go

+1
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ func (l *Loader) startGoferMonitor(info *containerInfo) {
12481248
if err := l.signalAllProcesses(info.cid, int32(linux.SIGKILL)); err != nil {
12491249
log.Warningf("Error killing container %q after gofer stopped: %s", info.cid, err)
12501250
}
1251+
l.k.RemoveDevGofer(info.containerName)
12511252
}
12521253
}()
12531254
}

0 commit comments

Comments
 (0)