Merge pull request #4044 from influxdata/dom/compactor-shutdown

fix: propagate shutdown into CompactorHandler
pull/24376/head
kodiakhq[bot] 2022-03-15 17:40:00 +00:00 committed by GitHub
commit 943cc3731c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -15,7 +15,6 @@ use metric::Registry;
use object_store::DynObjectStore;
use query::exec::Executor;
use time::TimeProvider;
use tokio_util::sync::CancellationToken;
use trace::TraceCollector;
use crate::{
@ -27,7 +26,6 @@ use crate::{
#[derive(Debug)]
pub struct CompactorServerType<C: CompactorHandler> {
server: CompactorServer<C>,
shutdown: CancellationToken,
trace_collector: Option<Arc<dyn TraceCollector>>,
}
@ -35,7 +33,6 @@ impl<C: CompactorHandler> CompactorServerType<C> {
pub fn new(server: CompactorServer<C>, common_state: &CommonServerState) -> Self {
Self {
server,
shutdown: CancellationToken::new(),
trace_collector: common_state.trace_collector(),
}
}
@ -71,11 +68,11 @@ impl<C: CompactorHandler + std::fmt::Debug + 'static> ServerType for CompactorSe
}
async fn join(self: Arc<Self>) {
self.shutdown.cancelled().await;
self.server.join().await;
}
fn shutdown(&self) {
self.shutdown.cancel();
self.server.shutdown();
}
}