code: func (s *Server) GracefulDown(ctx context.Context, done chan struct{}) {
  	logutil.Logger(ctx).Info("[server] graceful shutdown.")
  	metrics.ServerEventCounter.WithLabelValues(metrics.EventGracefulDown).Inc()
  
  	count := s.ConnectionCount()
  	for i := 0; count > 0; i++ {
  		s.kickIdleConnection()
  
  		count = s.ConnectionCount()
  		if count == 0 {
  			break
  		}
  		// Print information for every 30s.
  		if i%30 == 0 {
  			logutil.Logger(ctx).Info("graceful shutdown...", zap.Int("conn count", count))
  		}
  		ticker := time.After(time.Second)
  		select {
  		case <-ctx.Done():
  			return
  		case <-ticker:
  		}
  	}
  	close(done)
  }
docs: // GracefulDown waits all clients to close.