code: def disconnect(self):
          
          if self.proto:
              log.debug('%r Disconnecting from %r', self, self.proto.transport.getPeer())
              self.proto.transport.loseConnection()
docs: Disconnect from the Kafka broker.
  
          This is used to implement disconnection on timeout as a workaround for
          Kafka connections occasionally getting stuck on the server side under
          load. Requests are not cancelled, so they will be retried.