[master] fix defer release txdesc's ref in tx-timer

This commit is contained in:
chinaxing
2023-02-06 23:30:36 +08:00
committed by ob-robot
parent eb9e752f37
commit b851dbec40

View File

@ -158,7 +158,8 @@ void ObTxTimeoutTask::runTimerTask()
// because the handle_tx_commit_timeout may cause tx terminate
// its execution and release all resource include current object
// it is unsafe to use any member field after call handle func.
DEFER_C({ txs_->release_tx_ref(*tx_desc_); });
auto txs = txs_; auto tx_desc = tx_desc_;
DEFER({ txs->release_tx_ref(*tx_desc); });
if (tx_desc_->is_xa_trans()) {
if (OB_FAIL(txs_->handle_timeout_for_xa(*tx_desc_, delay_))) {
TRANS_LOG(WARN, "fail to handle timeout", K(ret), KPC_(tx_desc));