diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-11-01 11:44:07 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-11-01 11:49:31 -0700 |
commit | e70f28664af53b0428405c695c90a91b9bb43f67 (patch) | |
tree | 58b30d547d2737fcfb96164b9bd072d86cf20aa9 /runsc/boot/loader.go | |
parent | 5694bd080e0e95ba18cbf77038f450fe33b9f8df (diff) |
Allow the watchdog to detect when the sandbox is stuck during setup.
The watchdog currently can find stuck tasks, but has no way to tell if the
sandbox is stuck before the application starts executing.
This CL adds a startup timeout and action to the watchdog. If Start() is not
called before the given timeout (if non-zero), then the watchdog will take the
action.
PiperOrigin-RevId: 277970577
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r-- | runsc/boot/loader.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index 86df384f8..4d1bd2d08 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -300,7 +300,9 @@ func New(args Args) (*Loader, error) { } // Create a watchdog. - dog := watchdog.New(k, watchdog.DefaultTimeout, args.Conf.WatchdogAction) + dogOpts := watchdog.DefaultOpts + dogOpts.TaskTimeoutAction = args.Conf.WatchdogAction + dog := watchdog.New(k, dogOpts) procArgs, err := newProcess(args.ID, args.Spec, creds, k, k.RootPIDNamespace()) if err != nil { |