Fixed an issue where the thread did not exit due to insufficient error checking.

This commit is contained in:
oceanoverflow 2024-11-08 09:47:35 +00:00 committed by ob-robot
parent e151889100
commit bc92c041a6

View File

@ -3037,7 +3037,14 @@ int ObBackupMacroBlockTaskMgr::wait_task_(const int64_t task_id)
int ret = OB_SUCCESS;
while (OB_SUCC(ret) && task_id != ATOMIC_LOAD(&cur_task_id_)) {
ObThreadCondGuard guard(cond_);
if (OB_FAIL(cond_.wait(DEFAULT_WAIT_TIME_MS))) {
if (OB_ISNULL(ls_backup_ctx_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("ls backup ctx should not be null", K(ret));
} else if (OB_SUCCESS != ls_backup_ctx_->get_result_code()) {
ret = ls_backup_ctx_->get_result_code();
LOG_INFO("ls backup ctx already failed", K(ret));
break;
} else if (OB_FAIL(cond_.wait(DEFAULT_WAIT_TIME_MS))) {
if (OB_TIMEOUT == ret) {
ret = OB_SUCCESS;
LOG_WARN("waiting for task too slow", K(ret), K(task_id), K(cur_task_id_));