add destroy thread gracefully

This commit is contained in:
zhjc1124
2023-06-08 07:42:27 +00:00
committed by ob-robot
parent 340151ccc9
commit f4b390d643
25 changed files with 203 additions and 39 deletions

View File

@ -127,7 +127,7 @@ void ObArchiveSchedulerService::stop()
int ret = OB_SUCCESS;
if (IS_NOT_INIT) {
ret = OB_NOT_INIT;
LOG_ERROR("not init", K(ret));
LOG_WARN("not init", K(ret));
} else {
ObRsReentrantThread::stop();
idling_.wakeup();
@ -135,6 +135,34 @@ void ObArchiveSchedulerService::stop()
}
}
void ObArchiveSchedulerService::wait()
{
int ret = OB_SUCCESS;
if (IS_NOT_INIT) {
ret = OB_NOT_INIT;
LOG_WARN("not init", K(ret));
} else {
ObRsReentrantThread::wait();
LOG_INFO("wait archive scheduler service");
}
}
int ObArchiveSchedulerService::destroy()
{
int ret = OB_SUCCESS;
if (IS_NOT_INIT) {
ret = OB_NOT_INIT;
LOG_WARN("not init", K(ret));
} else {
if(OB_FAIL(ObRsReentrantThread::destroy())) {
LOG_WARN("ObRsReentrantThread::destroy failed", K(ret));
}
is_inited_ = false;
LOG_INFO("destroy archive scheduler service", K(ret));
}
return ret;
}
void ObArchiveSchedulerService::wakeup()
{
idling_.wakeup();