Skip to content

Commit

Permalink
let additional batch queries block the session
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Mar 8, 2024
1 parent d5a77d3 commit a31d6fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/src/scheduler/distributed/query_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ impl QueryManager {
}
}

fn get_permit(&self) -> SchedulerResult<Option<OwnedSemaphorePermit>> {
async fn get_permit(&self) -> SchedulerResult<Option<OwnedSemaphorePermit>> {
match self.distributed_query_semaphore {
Some(ref semaphore) => {
let permit = semaphore.clone().try_acquire_owned();
let permit = semaphore.clone().acquire_owned().await;
match permit {
Ok(permit) => Ok(Some(permit)),
Err(_) => {
Expand Down Expand Up @@ -198,7 +198,7 @@ impl QueryManager {
));
}
let query_id = query.query_id.clone();
let permit = self.get_permit()?;
let permit = self.get_permit().await?;
let query_execution = Arc::new(QueryExecution::new(query, context.session().id(), permit));

// Add queries status when begin.
Expand Down

0 comments on commit a31d6fd

Please sign in to comment.