def _handle_message(self, conn, message):
        self.total_rdy = max(self.total_rdy - 1, 0)

        rdy_conn = conn
        if self.max_in_flight > len(self.conns) and time.time() - self.random_rdy_ts > 30:
            # if all connections aren't getting RDY
            # occsionally randomize which connection gets RDY
            self.random_rdy_ts = time.time()
            conns_with_no_rdy = [c for c in self.conns.itervalues() if not c.rdy]
            if conns_with_no_rdy:
                rdy_conn = random.choice(conns_with_no_rdy)
                if rdy_conn is not conn:
                    logger.info('[%s:%s] redistributing RDY to %s',
                                conn.id, self.name, rdy_conn.id)

        self._maybe_update_rdy(rdy_conn)

        success = False
        try:
            if 0 < self.max_tries < message.attempts:
                self.giving_up(message)
                return message.finish()
            pre_processed_message = self.preprocess_message(message)
            if not self.validate_message(pre_processed_message):
                return message.finish()
            success = self.process_message(message)
        except Exception:
            logger.exception('[%s:%s] uncaught exception while handling message %s body:%r',
                             conn.id, self.name, message.id, message.body)
            if not message.has_responded():
                return message.requeue()

        if not message.is_async() and not message.has_responded():
            assert success is not None, 'ambiguous return value for synchronous mode'
            if success:
                return message.finish()
            return message.requeue()
dataset/ETHPy150Open nsqio/pynsq/nsq/reader.py/Reader._handle_message/swapped operands of `>`