fix hang in destroy

This commit is contained in:
nroskill 2024-02-02 14:17:42 +00:00 committed by ob-robot
parent fc19d0ef3c
commit 6808b647ff
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));
}
}
if (OB_FAIL(ret)) {
if (OB_UNLIKELY(!is_inited_)) {
destroy();
}
return ret;
@ -661,13 +661,15 @@ void ObTenantIOManager::destroy()
ATOMIC_STORE(&is_working_, false);
const int64_t start_ts = ObTimeUtility::current_time();
while (1 != 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()));
if (is_inited_) {
while (1 != 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;
if (OB_NOT_NULL(io_scheduler_) && OB_FAIL(io_scheduler_->remove_phyqueues(MTL_ID()))) {

View File

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