code: def _fail(self, request_id, failure, duration):
          
          self.listeners.publish_command_failure(
              duration, failure, self.name,
              request_id, self.sock_info.address, self.op_id)
docs: Publish a CommandFailedEvent.