code: func (sm *SyncManager) Stop() error {
  	if atomic.AddInt32(&sm.shutdown, 1) != 1 {
  		log.Warnf("Sync manager is already in the process of " +
  			"shutting down")
  		return nil
  	}
  
  	log.Infof("Sync manager shutting down")
  	close(sm.quit)
  	sm.wg.Wait()
  	return nil
  }
docs: // Stop gracefully shuts down the sync manager by stopping all asynchronous
  // handlers and waiting for them to finish.