[CP] fix missing px_loop_cond_wait wait event

This commit is contained in:
AntiTopQuark
2025-01-24 07:14:59 +00:00
committed by ob-robot
parent e1d45256be
commit 5fa044c952
2 changed files with 12 additions and 6 deletions

View File

@ -33,10 +33,16 @@ public:
uint32_t get_key() { return ATOMIC_LOAD(&futex_.uval()); }
void wait(uint32_t key, int64_t timeout) {
if (timeout > 0 && get_key() == key) {
ObWaitEventGuard guard(event_no_, timeout / 1000, reinterpret_cast<int64_t>(this), 0, 0, true);
ATOMIC_FAA(&n_waiters_, 1);
futex_.wait(key, timeout);
ATOMIC_FAA(&n_waiters_, -1);
if (ObWaitEventIds::DEFAULT_COND_WAIT != event_no_) {
ObWaitEventGuard guard(event_no_, timeout / 1000, reinterpret_cast<int64_t>(this), 0, 0, true);
ATOMIC_FAA(&n_waiters_, 1);
futex_.wait(key, timeout);
ATOMIC_FAA(&n_waiters_, -1);
} else {
ATOMIC_FAA(&n_waiters_, 1);
futex_.wait(key, timeout);
ATOMIC_FAA(&n_waiters_, -1);
}
}
}

View File

@ -641,8 +641,8 @@ ObWaitEventGuard::ObWaitEventGuard(const int64_t event_no, const uint64_t timeou
: event_no_(0), di_(nullptr), is_atomic_(is_atomic)
{
di_ = ObLocalDiagnosticInfo::get();
if (OB_NOT_NULL(di_) && oceanbase::lib::is_diagnose_info_enabled() &&
di_->get_ash_stat().is_active_session_) { need_record_ = true;
if (OB_NOT_NULL(di_) && di_->get_ash_stat().is_active_session_ && oceanbase::lib::is_diagnose_info_enabled()) {
need_record_ = true;
event_no_ = event_no;
di_->begin_wait_event(event_no, timeout_ms, p1, p2, p3);
} else {