code: func (c *client) Restore(ctx context.Context, id string, attachStdio libcontainerdtypes.StdioCallback) (alive bool, pid int, p libcontainerdtypes.Process, err error) {
  	var dio *cio.DirectIO
  	defer func() {
  		if err != nil && dio != nil {
  			dio.Cancel()
  			dio.Close()
  		}
  		err = wrapError(err)
  	}()
  
  	ctr, err := c.client.LoadContainer(ctx, id)
  	if err != nil {
  		return false, -1, nil, errors.WithStack(wrapError(err))
  	}
  
  	attachIO := func(fifos *cio.FIFOSet) (cio.IO, error) {
  		// dio must be assigned to the previously defined dio for the defer above
  		// to handle cleanup
  		dio, err = c.newDirectIO(ctx, fifos)
  		if err != nil {
  			return nil, err
  		}
  		return attachStdio(dio)
  	}
  	t, err := ctr.Task(ctx, attachIO)
  	if err != nil && !containerderrors.IsNotFound(err) {
  		return false, -1, nil, errors.Wrap(wrapError(err), "error getting containerd task for container")
  	}
  
  	if t != nil {
  		s, err := t.Status(ctx)
  		if err != nil {
  			return false, -1, nil, errors.Wrap(wrapError(err), "error getting task status")
  		}
  		alive = s.Status != containerd.Stopped
  		pid = int(t.Pid())
  	}
  
  	c.logger.WithFields(logrus.Fields{
  		"container": id,
  		"alive":     alive,
  		"pid":       pid,
  	}).Debug("restored container")
  
  	return alive, pid, &restoredProcess{
  		p: t,
  	}, nil
  }
docs: // Restore loads the containerd container.
  // It should not be called concurrently with any other operation for the given ID.