Skip to content

Commit 432a428

Browse files
authored
refactor(query): add local semaphore for reduce meta's request (#18572)
* refactor(query): add local queue * refactor(query): add local queue
1 parent 2209e45 commit 432a428

File tree

4 files changed

+651
-35
lines changed

4 files changed

+651
-35
lines changed

src/common/base/src/runtime/workload_group.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use std::sync::atomic::AtomicUsize;
1919
use std::sync::Arc;
2020
use std::time::Duration;
2121

22+
use tokio::sync::Semaphore;
23+
2224
use crate::runtime::MemStat;
2325

2426
pub const CPU_QUOTA_KEY: &str = "cpu_quota";
@@ -77,6 +79,8 @@ impl WorkloadGroup {
7779
pub struct WorkloadGroupResource {
7880
pub meta: WorkloadGroup,
7981
pub queue_key: String,
82+
pub permits: usize,
83+
pub semaphore: Arc<Semaphore>,
8084
pub mem_stat: Arc<MemStat>,
8185
pub max_memory_usage: Arc<AtomicUsize>,
8286
#[allow(clippy::type_complexity)]

0 commit comments

Comments
 (0)