ash错误记录空闲等待时间为on cpu时间

This commit is contained in:
obdev
2025-03-25 16:46:59 +00:00
committed by ob-robot
parent 5aaabaf8f8
commit 51e8cd254f
5 changed files with 8 additions and 2 deletions

View File

@ -590,6 +590,7 @@ void ObTimerService::run1()
ObMonitor<Mutex>::Lock guard(monitor_);
while(!is_stopped_ && 0 == priority_task_queue_.size()) {
ObBKGDSessInActiveGuard inactive_guard;
monitor_.wait();
}
if (is_stopped_) {
@ -613,6 +614,7 @@ void ObTimerService::run1()
int64_t wait_time = st - now;
wait_time = MIN(wait_time, MAX_WAIT_INTERVAL);
wait_time = MAX(wait_time, MIN_WAIT_INTERVAL);
ObBKGDSessInActiveGuard inactive_guard;
monitor_.timed_wait(ObSysTime(wait_time));
} else {
VecIter it = nullptr;
@ -634,6 +636,7 @@ void ObTimerService::run1()
}
} else {
check_clock();
ObBKGDSessInActiveGuard inactive_guard;
monitor_.timed_wait(ObSysTime(first_token->scheduled_time_ - now));
}
}

View File

@ -615,7 +615,7 @@ void ObSimpleThreadPoolDynamicMgr::run1()
dec_pools[i]->dec_ref();
}
++loop_cnt;
ob_usleep(CHECK_INTERVAL_US);
ob_usleep(CHECK_INTERVAL_US, true);
}
}

View File

@ -231,7 +231,7 @@ void ObArchiveSender::do_thread_task_()
if (OB_FAIL(try_free_send_task_())) {
ARCHIVE_LOG(WARN, "try free send task failed", K(ret));
}
usleep(100 * 1000L);
ob_usleep(100 * 1000L, true /*idle sleep*/);
}
if (REACH_TIME_INTERVAL(10 * 1000 * 1000L)) {
@ -326,6 +326,7 @@ int ObArchiveSender::get_send_task_(ObArchiveSendTask *&task, bool &exist)
// if no task exist, sleep
if (! exist) {
common::ObBKGDSessInActiveGuard inactive_guard;
send_cond_.timedwait(10 * 1000L);
}

View File

@ -401,6 +401,7 @@ void ObMacroBlockBloomFilterLoadTG::run1()
}
// Wait for next request.
ObBKGDSessInActiveGuard inactive_guard;
ObThreadCondGuard guard(idle_cond_);
idle_cond_.wait(10 * 1000 /* 10s */);
}

View File

@ -939,6 +939,7 @@ void ObTmpFileSwapTG::run1()
int64_t flush_idle_time = flush_tg_ref_.cal_idle_time();
int64_t idle_time = min(swap_idle_time, flush_idle_time);
if (!has_set_stop() && idle_time != 0) {
ObBKGDSessInActiveGuard inactive_guard;
idle_cond_.wait(idle_time);
}
}