diff --git a/runtime/container.go b/runtime/container.go index d2ba13d00..23abe09ea 100644 --- a/runtime/container.go +++ b/runtime/container.go @@ -138,7 +138,7 @@ func New(opts ContainerOpts) (Container, error) { return c, nil } -func Load(root, id string) (Container, error) { +func Load(root, id string, timeout time.Duration) (Container, error) { var s state f, err := os.Open(filepath.Join(root, id, StateFile)) if err != nil { @@ -158,6 +158,7 @@ func Load(root, id string) (Container, error) { shim: s.Shim, noPivotRoot: s.NoPivotRoot, processes: make(map[string]*process), + timeout: timeout, } dirs, err := ioutil.ReadDir(filepath.Join(root, id)) if err != nil { diff --git a/supervisor/supervisor.go b/supervisor/supervisor.go index 012eef20a..cd3f87c38 100644 --- a/supervisor/supervisor.go +++ b/supervisor/supervisor.go @@ -305,7 +305,7 @@ func (s *Supervisor) restore() error { continue } id := d.Name() - container, err := runtime.Load(s.stateDir, id) + container, err := runtime.Load(s.stateDir, id, s.timeout) if err != nil { return err }