diff options
author | Rahat Mahmood <rahat@google.com> | 2019-08-08 12:32:00 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-08 12:33:11 -0700 |
commit | 13a98df49ea1b36cd21c528293b626a6a3639f0b (patch) | |
tree | 02170fcb8caf79ad519ee812ce9f8c5f1093501c /runsc/boot | |
parent | 2e45d1696e41d9042164b1b05d0dcd39dd15dfce (diff) |
netstack: Don't start endpoint goroutines too soon on restore.
Endpoint protocol goroutines were previously started as part of
loading the endpoint. This is potentially too soon, as resources used
by these goroutine may not have been loaded. Protocol goroutines may
perform meaningful work as soon as they're started (ex: incoming
connect) which can cause them to indirectly access resources that
haven't been loaded yet.
This CL defers resuming all protocol goroutines until the end of
restore.
PiperOrigin-RevId: 262409429
Diffstat (limited to 'runsc/boot')
-rw-r--r-- | runsc/boot/controller.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go index 0285f599d..72cbabd16 100644 --- a/runsc/boot/controller.go +++ b/runsc/boot/controller.go @@ -379,13 +379,10 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error { // Load the state. loadOpts := state.LoadOpts{Source: specFile} - if err := loadOpts.Load(k, networkStack); err != nil { + if err := loadOpts.Load(k, networkStack, time.NewCalibratedClocks()); err != nil { return err } - // Set timekeeper. - k.Timekeeper().SetClocks(time.NewCalibratedClocks()) - // Since we have a new kernel we also must make a new watchdog. dog := watchdog.New(k, watchdog.DefaultTimeout, cm.l.conf.WatchdogAction) |