code: func (m *Manager) NotifyFailedServer(s *metadata.Server) {
  	l := m.getServerList()
  
  	// If the server being failed is not the first server on the list,
  	// this is a noop.  If, however, the server is failed and first on
  	// the list, acquire the lock, retest, and take the penalty of moving
  	// the server to the end of the list.
  
  	// Only rotate the server list when there is more than one server
  	if len(l.servers) > 1 && l.servers[0].Name == s.Name &&
  		// Use atomic.CAS to emulate a TryLock().
  		atomic.CompareAndSwapInt32(&m.notifyFailedBarrier, 0, 1) {
  		defer atomic.StoreInt32(&m.notifyFailedBarrier, 0)
  
  		// Grab a lock, retest, and take the hit of cycling the first
  		// server to the end.
  		m.listLock.Lock()
  		defer m.listLock.Unlock()
  		l = m.getServerList()
  
  		if len(l.servers) > 1 && l.servers[0].Name == s.Name {
  			l.servers = l.cycleServer()
  			m.saveServerList(l)
  			m.logger.Printf(`[DEBUG] manager: cycled away from server "%s"`, s.Name)
  		}
  	}
  }
docs: // NotifyFailedServer marks the passed in server as "failed" by rotating it
  // to the end of the server list.