fix core when create worker after set tenant stop

This commit is contained in:
obdev
2023-02-07 16:58:05 +08:00
committed by ob-robot
parent a8767462ad
commit 429b548696

View File

@ -1385,7 +1385,10 @@ int ObMultiTenant::remove_tenant(const uint64_t tenant_id, bool &try_clock_succ)
LOG_ERROR("fail to kill tenant session", K(ret), K(tenant_id));
} else {
LOG_INFO("removed_tenant begin to stop", K(tenant_id));
{
SpinWLockGuard guard(lock_); //add a lock when set tenant stop, omt will check tenant has stop before calling timeup()
removed_tenant->stop();
}
LOG_INFO("removed_tenant begin to wait", K(tenant_id));
removed_tenant->wait();
LOG_INFO("removed_tenant begin to try wlock", K(tenant_id));