Skip to content

Commit

Permalink
fix: fix test_scheduler_continuous_stop in scheduler (GreptimeTeam#2252)
Browse files Browse the repository at this point in the history
* fix: fix test_scheduler_continuous_stop in scheduler

Signed-off-by: ZhuZiyi <[email protected]>

* chore: add document annotation

Signed-off-by: ZhuZiyi <[email protected]>

---------

Signed-off-by: ZhuZiyi <[email protected]>
  • Loading branch information
Nateiru authored and paomian committed Oct 19, 2023
1 parent 49c298d commit a377bc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mito2/src/schedule/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ impl Scheduler for LocalScheduler {
.map_err(|_| InvalidFlumeSenderSnafu {}.build())
}

/// if await_termination is true, scheduler will wait all tasks finished before stopping
async fn stop(&self, await_termination: bool) -> Result<()> {
ensure!(
self.state.load(Ordering::Relaxed) == STATE_RUNNING,
Expand Down Expand Up @@ -235,7 +236,7 @@ mod tests {
let local_stop = local.clone();
tokio::spawn(async move {
tokio::time::sleep(Duration::from_millis(5)).await;
local_stop.stop(false).await.unwrap();
local_stop.stop(true).await.unwrap();
barrier_clone.wait().await;
});

Expand Down

0 comments on commit a377bc8

Please sign in to comment.