feat: simplify shutdown (#1502)
* feat: simplify shutdown * chore: fix lint Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/24376/head
parent
07db4932ee
commit
91a45fd380
|
@ -91,8 +91,6 @@ use object_store::{path::ObjectStorePath, ObjectStore, ObjectStoreApi};
|
|||
use query::{exec::Executor, DatabaseStore};
|
||||
use tracker::{TaskId, TaskRegistration, TaskRegistryWithHistory, TaskTracker, TrackedFutureExt};
|
||||
|
||||
use futures::{pin_mut, FutureExt};
|
||||
|
||||
use crate::{
|
||||
config::{
|
||||
object_store_path_for_database_config, Config, GRpcConnectionString, DB_RULES_FILE_NAME,
|
||||
|
@ -801,21 +799,8 @@ impl<M: ConnectionManager> Server<M> {
|
|||
}
|
||||
}
|
||||
|
||||
info!("shutting down background worker");
|
||||
|
||||
let join = self.config.drain().fuse();
|
||||
pin_mut!(join);
|
||||
|
||||
// Keep running reclaim whilst shutting down in case something
|
||||
// is waiting on a tracker to complete
|
||||
loop {
|
||||
self.jobs.inner.lock().reclaim();
|
||||
|
||||
futures::select! {
|
||||
_ = interval.tick().fuse() => {},
|
||||
_ = join => break
|
||||
}
|
||||
}
|
||||
info!("shutting down background workers");
|
||||
self.config.drain().await;
|
||||
|
||||
info!("draining tracker registry");
|
||||
|
||||
|
|
Loading…
Reference in New Issue