Skip to content

Commit

Permalink
A little more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmturner committed Nov 13, 2024
1 parent aba2d21 commit cfe58cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ itertools = "0.13.0"
lazy_static = "1.4.0"
log = "0.4.22"
object_store = { version = "0.10.2", features = ["aws"], optional = true }
parking_lot = "0.12.3"
pin-project-lite = {version = "0.2.14" }
prost = "0.12.3"
ratatui = "0.28.0"
Expand Down
18 changes: 10 additions & 8 deletions src/execution/dedicated_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@
// under the License.

use std::{
sync::{Arc, OnceLock, RwLock},
sync::{Arc, OnceLock},
time::Duration,
};

use futures::{
future::{BoxFuture, Shared},
FutureExt,
Future, FutureExt, TryFutureExt,
};
use log::warn;
use parking_lot::RwLock;
use tokio::{
runtime::Handle,
sync::{oneshot::error::RecvError, Notify},
task::JoinSet,
};

const SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(60 * 5);
Expand Down Expand Up @@ -84,6 +86,11 @@ const SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(60 * 5);
/// context.', .../tokio-1.4.0/src/runtime/blocking/shutdown.rs:51:21
struct DedicatedExecutor {
state: Arc<RwLock<State>>,

/// Used for testing.
///
/// This will ignore explicit shutdown requests.
testing: bool,
}

/// [`DedicatedExecutor`] for testing purposes.
Expand Down Expand Up @@ -182,12 +189,7 @@ impl DedicatedExecutor {
// - https://github.com/influxdata/influxdb_iox/pull/11030
runtime_builder.enable_time();

Self::new_inner(
"testing",
runtime_builder,
Arc::new(Registry::default()),
true,
)
Self::new_inner("testing", runtime_builder, true)
})
.clone()
}
Expand Down

0 comments on commit cfe58cd

Please sign in to comment.