oceanbase icon indicating copy to clipboard operation
oceanbase copied to clipboard

ObReqQueue::loop() code issues

Open yungoo opened this issue 5 years ago • 1 comments

code review problem

https://github.com/oceanbase/oceanbase/blob/master/deps/oblib/src/rpc/frame/ob_req_queue_thread.cpp#166

    } else if (0 == queue_.size()) {
      LOG_INFO("exiting queue thread and wait remain finish");
      // Process remains if we should wait until all task has been
      // processed before exiting this thread. Previous return code
      // isn't significant, we just ignore it to make progress. When
      // queue pop a normal task we process it until pop fails.
      ret = OB_SUCCESS;
      while (OB_SUCC(ret)) {
        if (OB_FAIL(queue_.pop(task, timeout))) {
          LOG_DEBUG("queue pop task fail", K(&queue_));
        } else if (NULL != task) {
          process_task(task);  // ignore return code.
        } else {
          // unexpected
          LOG_ERROR("queue pop successfully but task is NULL");
        }
      }
    }

line 166 should be

    } else if (0 != queue_.size()) {

yungoo avatar Jun 24 '21 02:06 yungoo

Good Catch. Thanks

Could you please raise one pull request for this issue.

longdafeng avatar Jun 27 '21 03:06 longdafeng