code: func (s *Serf) handleQueryResponse(resp *messageQueryResponse) {
  	// Look for a corresponding QueryResponse
  	s.queryLock.RLock()
  	query, ok := s.queryResponse[resp.LTime]
  	s.queryLock.RUnlock()
  	if !ok {
  		s.logger.Printf("[WARN] serf: reply for non-running query (LTime: %d, ID: %d) From: %s",
  			resp.LTime, resp.ID, resp.From)
  		return
  	}
  
  	// Verify the ID matches
  	if query.id != resp.ID {
  		s.logger.Printf("[WARN] serf: query reply ID mismatch (Local: %d, Response: %d)",
  			query.id, resp.ID)
  		return
  	}
  
  	// Check if the query is closed
  	if query.Finished() {
  		return
  	}
  
  	// Process each type of response
  	if resp.Ack() {
  		// Exit early if this is a duplicate ack
  		if _, ok := query.acks[resp.From]; ok {
  			metrics.IncrCounter([]string{"serf", "query_duplicate_acks"}, 1)
  			return
  		}
  
  		metrics.IncrCounter([]string{"serf", "query_acks"}, 1)
  		select {
  		case query.ackCh <- resp.From:
  			query.acks[resp.From] = struct{}{}
  		default:
  			s.logger.Printf("[WARN] serf: Failed to deliver query ack, dropping")
  		}
  	} else {
  		// Exit early if this is a duplicate response
  		if _, ok := query.responses[resp.From]; ok {
  			metrics.IncrCounter([]string{"serf", "query_duplicate_responses"}, 1)
  			return
  		}
  
  		metrics.IncrCounter([]string{"serf", "query_responses"}, 1)
  		err := query.sendResponse(NodeResponse{From: resp.From, Payload: resp.Payload})
  		if err != nil {
  			s.logger.Printf("[WARN] %v", err)
  		}
  	}
  }
docs: // handleResponse is called when a query response is
  // received.