code: func (s *State) Acquire() error {
  	s.dbCond.L.Lock()
  	defer s.dbCond.L.Unlock()
  	if s.stateDB == nil {
  		return ErrDBClosed
  	}
  	s.dbUsers++
  	return nil
  }
docs: // Acquire acquires the state for use by incrementing s.dbUsers, which prevents
  // the state DB being closed until the caller has finished performing actions
  // which will lead to changes being persisted to the DB.
  //
  // For example, running a job starts the job and then persists the change of
  // state, but if the DB is closed in that time then the state of the running
  // job will be lost.
  //
  // ErrDBClosed is returned if the DB is already closed so API requests will
  // fail before any actions are performed.