Fix: There is a concurrency problem with on_get_session

This commit is contained in:
yaojing624
2023-12-06 09:13:04 +00:00
committed by ob-robot
parent 7a441764f3
commit d8ccc0fc9f

View File

@ -6471,6 +6471,7 @@ int ObExecEnv::store(ObBasicSessionInfo &session)
void ObBasicSessionInfo::on_get_session()
{
LockGuard lock_guard(thread_data_mutex_);
const char *str = lbt();
int len = STRLEN(str);
if (sess_bt_buff_pos_ + len + 2 < MAX_SESS_BT_BUFF_SIZE) {
@ -6488,6 +6489,7 @@ void ObBasicSessionInfo::on_get_session()
void ObBasicSessionInfo::on_revert_session()
{
LockGuard lock_guard(thread_data_mutex_);
int32_t v = ATOMIC_AAF(&sess_ref_cnt_, -1);
if (v <= 0) {
sess_bt_buff_pos_ = 0;