summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/controller.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-06-25 15:43:17 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-25 15:43:17 -0700
commite5526f4f2696a2334d61b05f31ad23b7bee4342b (patch)
tree537f2f2c048137c2483b94c127059cbaf54dd642 /runsc/boot/controller.go
parentf00077e8d8d59ee6db93a3ece24c5f3f5156eda5 (diff)
parentd703340bc04a4269f420fdf24d946abcbc6a620b (diff)
Merge pull request #6222 from avagin:stop
PiperOrigin-RevId: 381561785
Diffstat (limited to 'runsc/boot/controller.go')
-rw-r--r--runsc/boot/controller.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go
index d52cf5a00..34f939953 100644
--- a/runsc/boot/controller.go
+++ b/runsc/boot/controller.go
@@ -18,6 +18,7 @@ import (
"errors"
"fmt"
"os"
+ gtime "time"
specs "github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/sys/unix"
@@ -165,8 +166,11 @@ func newController(fd int, l *Loader) (*controller, error) {
return ctrl, nil
}
+// stopRPCTimeout is the time for clients to complete ongoing RPCs.
+const stopRPCTimeout = 15 * gtime.Second
+
func (c *controller) stop() {
- c.srv.Stop()
+ c.srv.Stop(stopRPCTimeout)
}
// containerManager manages sandbox containers.