// Stop closes the connections with Riak at the configured remoteAddress and removes the connections
// from the active pool
337453
func (n *Node) stop() error {
	if err := n.stateCheck(nodeRunning, nodeHealthChecking); err != nil {
		return err
	}

	logDebug("[Node]", "(%v) shutting down.", n)

	n.setState(nodeShuttingDown)
	close(n.stopChan)

	err := n.cm.stop()

	if err == nil {
		n.setState(nodeShutdown)
		logDebug("[Node]", "(%v) shut down.", n)
	} else {
		n.setState(nodeError)
		logErr("[Node]", err)
	}

	return err
}
1027085
func (r *Robot) Stop() error {
	var result error
	log.Println("Stopping Robot", r.Name, "...")
	err := r.Devices().Halt()
	if err != nil {
		result = multierror.Append(result, err)
	}
	err = r.Connections().Finalize()
	if err != nil {
		result = multierror.Append(result, err)
	}

	r.done <- true
	r.running.Store(false)
	return result
}
589892
func (o *Outbound) Stop() error {
	return o.once.Stop(o.peerChooser.Stop)
}
627741
func (d *Driver) Stop() error {
	if err := stopKubelet(d.exec); err != nil {
		return err
	}
	containers, err := d.runtime.ListContainers("")
	if err != nil {
		return errors.Wrap(err, "containers")
	}
	if len(containers) > 0 {
		if err := d.runtime.StopContainers(containers); err != nil {
			return errors.Wrap(err, "stop")
		}
	}
	return nil
}
454194
func (u *udpTransport) Stop() error {
	u.t.Kill(nil)
	return u.t.Wait()
}
986013
func (c *PCPClient) Stop() error {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	if !c.r.mapped {
		return errors.New("trying to stop an already stopped mapping")
	}

	c.stop()

	c.r.mapped = false

	err := c.writer.(*bytewriter.MemoryMappedWriter).Unmap(EraseFileOnStop)
	c.writer = nil
	if err != nil {
		return errors.Wrap(err, "client: error unmapping MemoryMappedBuffer")
	}

	return nil
}
1281236
func (mfw *MockFW) Stop(ctx context.Context, info map[string]string) (bool, error) {
	log.LoggerWContext(ctx).Info("Sending SSO through mocked Firewall SSO")
	return true, nil
}
1120241
func (b *blocksProviderImpl) Stop() {
	atomic.StoreInt32(&b.done, 1)
	b.client.Close()
}
1006734
func (s *MySQLServer) Stop() error {
	if s.mysqld == nil {
		panic("already stopped")
	}

	if s.DB != nil { // might not be initialized
		if err := s.DB.Close(); err != nil {
			return err
		}
	}

	if err := s.mysqld.Process.Signal(syscall.SIGTERM); err != nil {
		return err
	}

	if err := s.mysqld.Wait(); err != nil {
		return err
	}

	s.mysqld = nil

	return os.RemoveAll(s.dataDir)
}
1061894
func (c *CCProviderImpl) Stop(ccci *ccprovider.ChaincodeContainerInfo) error {
	return c.cs.Stop(ccci)
}
947633
func (s *Ethereum) Stop() error {
	s.bloomIndexer.Close()
	s.blockchain.Stop()
	s.engine.Close()
	s.protocolManager.Stop()
	if s.lesServer != nil {
		s.lesServer.Stop()
	}
	s.txPool.Stop()
	s.miner.Stop()
	s.eventMux.Stop()

	s.chainDb.Close()
	close(s.shutdownChan)
	return nil
}
294561
func (d *Driver) Stop() error {
	if err := d.verifyRootPermissions(); err != nil {
		return err
	}
	d.cleanupNfsExports()
	return d.sendSignal(syscall.SIGTERM)
}
380086
func (m *Streamer) Stop(streamID StreamID) {
	strm, ok := m.loadStream(streamID)
	if !ok {
		return
	}

	close(strm.done)

	go func() {
		// wait some time to ensure clients have connected, once they've
		// retrieved the stream from the map it's safe to delete the key
		time.Sleep(m.graceTime)

		m.streams.Delete(streamID)
	}()
}
440422
func (c *RPCClient) Stop() {
	c.quitMtx.Lock()
	select {
	case <-c.quit:
	default:
		close(c.quit)
		c.Client.Shutdown()

		if !c.started {
			close(c.dequeueNotification)
		}
	}
	c.quitMtx.Unlock()
}
862024
func (c *CouchDB) Stop() error {
	c.mutex.Lock()
	if c.stopped {
		c.mutex.Unlock()
		return errors.Errorf("container %s already stopped", c.containerID)
	}
	c.stopped = true
	c.mutex.Unlock()

	err := c.Client.StopContainer(c.containerID, 0)
	if err != nil {
		return err
	}

	return nil
}
110661
func (s *Server) Stop() {
	if atomic.CompareAndSwapInt32(&s.run, 1, 0) {
		log.Debug("RPC server shutting down")
		s.codecs.Each(func(c interface{}) bool {
			c.(ServerCodec).Close()
			return true
		})
	}
}
916329
func (h *Srv) Stop() <-chan struct{} {
	h.Lock()
	defer h.Unlock()
	if h.server != nil {
		h.server.Close()
		h.server = nil
		return h.doneCh
	}
	doneCh := make(chan struct{})
	close(doneCh)
	return doneCh
}