summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-19 23:52:48 +0000
committergVisor bot <gvisor-bot@google.com>2021-04-19 23:52:48 +0000
commit971b7fe85715e357907cdb576af52c48a22eaa99 (patch)
treea0fe1d30b267f863a44078adfcd3084d460f67d7 /runsc/boot
parentae3938ad39944b0d67ba0a6aba8efad9307b9868 (diff)
parent20b1c3c632277bd64eac4d0442bda9695f184fc9 (diff)
Merge release-20210412.0-34-g20b1c3c63 (automated)
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/loader.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 5d6e67279..798c1a7a7 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -492,10 +492,6 @@ func (l *Loader) Destroy() {
// save/restore.
l.k.Release()
- // All sentry-created resources should have been released at this point;
- // check for reference leaks.
- refsvfs2.DoLeakCheck()
-
// In the success case, stdioFDs and goferFDs will only contain
// released/closed FDs that ownership has been passed over to host FDs and
// gofer sessions. Close them here in case of failure.
@@ -1002,10 +998,12 @@ func (l *Loader) waitContainer(cid string, waitStatus *uint32) error {
ws := l.wait(tg)
*waitStatus = ws
- // Write coverage report after the root container has exited. This guarantees
- // that the report is written in cases where the sandbox is killed by a signal
- // after the ContainerWait request is completed.
+ // Check for leaks and write coverage report after the root container has
+ // exited. This guarantees that the report is written in cases where the
+ // sandbox is killed by a signal after the ContainerWait request is completed.
if l.root.procArgs.ContainerID == cid {
+ // All sentry-created resources should have been released at this point.
+ refsvfs2.DoLeakCheck()
coverage.Report()
}
return nil