fix hang in destroy

This commit is contained in:
nroskill
2024-02-10 04:51:03 +00:00
committed by ob-robot
parent e1fff07a84
commit 08575a7ae2
2 changed files with 9 additions and 7 deletions

View File

@ -79,7 +79,7 @@ int ObIOManager::init(const int64_t memory_limit,
LOG_WARN("init server tenant io mgr start failed", K(ret)); LOG_WARN("init server tenant io mgr start failed", K(ret));
} }
} }
if (OB_FAIL(ret)) { if (OB_UNLIKELY(!is_inited_)) {
destroy(); destroy();
} }
return ret; return ret;
@ -661,13 +661,15 @@ void ObTenantIOManager::destroy()
ATOMIC_STORE(&is_working_, false); ATOMIC_STORE(&is_working_, false);
const int64_t start_ts = ObTimeUtility::current_time(); const int64_t start_ts = ObTimeUtility::current_time();
while (1 != get_ref_cnt()) { if (is_inited_) {
if (REACH_TIME_INTERVAL(1000L * 1000L)) { //1s while (1 != get_ref_cnt()) {
LOG_INFO("wait tenant io manager quit", K(MTL_ID()), K(start_ts), K(get_ref_cnt())); if (REACH_TIME_INTERVAL(1000L * 1000L)) { //1s
LOG_INFO("wait tenant io manager quit", K(MTL_ID()), K(start_ts), K(get_ref_cnt()));
}
ob_usleep((useconds_t)10L * 1000L); //10ms
} }
ob_usleep((useconds_t)10L * 1000L); //10ms dec_ref();
} }
dec_ref();
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (OB_NOT_NULL(io_scheduler_) && OB_FAIL(io_scheduler_->remove_phyqueues(MTL_ID()))) { if (OB_NOT_NULL(io_scheduler_) && OB_FAIL(io_scheduler_->remove_phyqueues(MTL_ID()))) {

View File

@ -777,7 +777,7 @@ int ObIOTuner::init()
} else { } else {
is_inited_ = true; is_inited_ = true;
} }
if (OB_FAIL(ret)) { if (OB_UNLIKELY(!is_inited_)) {
destroy(); destroy();
} }
return ret; return ret;