fix hang in destroy
This commit is contained in:
@ -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,6 +661,7 @@ 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();
|
||||||
|
if (is_inited_) {
|
||||||
while (1 != get_ref_cnt()) {
|
while (1 != get_ref_cnt()) {
|
||||||
if (REACH_TIME_INTERVAL(1000L * 1000L)) { //1s
|
if (REACH_TIME_INTERVAL(1000L * 1000L)) { //1s
|
||||||
LOG_INFO("wait tenant io manager quit", K(MTL_ID()), K(start_ts), K(get_ref_cnt()));
|
LOG_INFO("wait tenant io manager quit", K(MTL_ID()), K(start_ts), K(get_ref_cnt()));
|
||||||
@ -668,6 +669,7 @@ void ObTenantIOManager::destroy()
|
|||||||
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()))) {
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user