fixed read data from oss successfully but return OB_TIMEOUT.

This commit is contained in:
HaHaJeff
2023-10-13 07:39:57 +00:00
committed by ob-robot
parent 8168f4dd7e
commit 2fa8a32352
2 changed files with 2 additions and 5 deletions

View File

@ -323,10 +323,7 @@ int ObLogExternalStorageHandler::wait_async_tasks_finished_(
const int64_t DEFAULT_WAIT_US = 50 * 1000;
int64_t print_log_interval = OB_INVALID_TIMESTAMP;
// if async_task_ctx->wait return OB_SUCCESS, means there is no flying task.
// if async_task_ctx->wait return error except OB_TIMEOUT, we can not return
// the errno until async_task_ctx has no flying task.
while (OB_FAIL(async_task_ctx->wait(DEFAULT_WAIT_US))
&& async_task_ctx->has_flying_async_task()) {
while (OB_FAIL(async_task_ctx->wait(DEFAULT_WAIT_US))) {
if (palf::palf_reach_time_interval(500*1000, print_log_interval)) {
CLOG_LOG(WARN, "wait ObLogExternalStorageIOTaskCtx failed", KPC(async_task_ctx));
}

View File

@ -100,7 +100,7 @@ int ObLogExternalStorageIOTaskCtx::wait(const int64_t timeout_us)
{
int ret = OB_SUCCESS;
ObThreadCondGuard guard(condition_);
while (OB_SUCC(ret) && flying_task_count_ > 0) {
while (flying_task_count_ > 0 && OB_SUCC(ret)) {
ret = condition_.wait_us(timeout_us);
}
return ret;