diff --git a/deps/oblib/src/lib/task/ob_timer_service.cpp b/deps/oblib/src/lib/task/ob_timer_service.cpp index d21e1bf832..152a20e9e5 100644 --- a/deps/oblib/src/lib/task/ob_timer_service.cpp +++ b/deps/oblib/src/lib/task/ob_timer_service.cpp @@ -590,6 +590,7 @@ void ObTimerService::run1() ObMonitor::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)); } } diff --git a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp index 5812109202..8bf6e28ddb 100644 --- a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp +++ b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp @@ -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); } } diff --git a/src/logservice/archiveservice/ob_archive_sender.cpp b/src/logservice/archiveservice/ob_archive_sender.cpp index a3339c134a..310c5ac90e 100644 --- a/src/logservice/archiveservice/ob_archive_sender.cpp +++ b/src/logservice/archiveservice/ob_archive_sender.cpp @@ -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); } diff --git a/src/storage/blocksstable/ob_bloom_filter_load_task.cpp b/src/storage/blocksstable/ob_bloom_filter_load_task.cpp index 3a04e644c2..d3fb8702f3 100644 --- a/src/storage/blocksstable/ob_bloom_filter_load_task.cpp +++ b/src/storage/blocksstable/ob_bloom_filter_load_task.cpp @@ -401,6 +401,7 @@ void ObMacroBlockBloomFilterLoadTG::run1() } // Wait for next request. + ObBKGDSessInActiveGuard inactive_guard; ObThreadCondGuard guard(idle_cond_); idle_cond_.wait(10 * 1000 /* 10s */); } diff --git a/src/storage/tmp_file/ob_tmp_file_thread_wrapper.cpp b/src/storage/tmp_file/ob_tmp_file_thread_wrapper.cpp index 823ff663f0..7027d67234 100644 --- a/src/storage/tmp_file/ob_tmp_file_thread_wrapper.cpp +++ b/src/storage/tmp_file/ob_tmp_file_thread_wrapper.cpp @@ -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); } }