Skip to content

Commit bc63dd1

Browse files
committed
ore: pend in wait_in_assert_finished instead
1 parent 218f638 commit bc63dd1

File tree

29 files changed

+162
-168
lines changed

29 files changed

+162
-168
lines changed

src/adapter/src/catalog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5281,7 +5281,7 @@ mod tests {
52815281
#[mz_ore::test(tokio::test)]
52825282
#[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `TLS_client_method` on OS `linux`
52835283
async fn test_smoketest_all_builtins() {
5284-
fn inner(catalog: Catalog) -> Vec<tokio::task::JoinHandle<()>> {
5284+
fn inner(catalog: Catalog) -> Vec<mz_ore::task::JoinHandle<()>> {
52855285
let catalog = Arc::new(catalog);
52865286
let conn_catalog = catalog.for_system_session();
52875287

src/adapter/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use mz_ore::collections::CollectionExt;
2525
use mz_ore::id_gen::IdAllocator;
2626
use mz_ore::now::{to_datetime, EpochMillis, NowFn};
2727
use mz_ore::result::ResultExt;
28-
use mz_ore::task::{AbortOnDropHandle, JoinHandleExt};
28+
use mz_ore::task::AbortOnDropHandle;
2929
use mz_ore::thread::JoinOnDropHandle;
3030
use mz_ore::tracing::OpenTelemetryContext;
3131
use mz_repr::{GlobalId, Row, ScalarType};

src/compute-client/src/controller/replica.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use differential_dataflow::lattice::Lattice;
1818
use mz_build_info::BuildInfo;
1919
use mz_cluster_client::client::{ClusterReplicaLocation, ClusterStartupEpoch, TimelyConfig};
2020
use mz_ore::retry::Retry;
21-
use mz_ore::task::{AbortOnDropHandle, JoinHandleExt};
21+
use mz_ore::task::AbortOnDropHandle;
2222
use mz_repr::GlobalId;
2323
use mz_service::client::{GenericClient, Partitioned};
2424
use mz_service::params::GrpcClientParameters;

src/compute/src/compute_state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use mz_compute_types::plan::Plan;
2929
use mz_expr::SafeMfpPlan;
3030
use mz_ore::cast::CastFrom;
3131
use mz_ore::metrics::UIntGauge;
32-
use mz_ore::task::{AbortHandleExt, AbortOnDropAbortHandle};
32+
use mz_ore::task::AbortOnDropHandle;
3333
use mz_ore::tracing::{OpenTelemetryContext, TracingHandle};
3434
use mz_persist_client::cache::PersistClientCache;
3535
use mz_persist_client::read::ReadHandle;
@@ -734,7 +734,7 @@ impl PendingPeek {
734734
});
735735
PendingPeek::Persist(PersistPeek {
736736
peek,
737-
_abort_handle: task_handle.abort_handle().abort_on_drop(),
737+
_abort_handle: task_handle.abort_on_drop(),
738738
result: result_rx,
739739
span: tracing::Span::current(),
740740
})
@@ -763,7 +763,7 @@ pub struct PersistPeek {
763763
pub(crate) peek: Peek,
764764
/// A background task that's responsible for producing the peek results.
765765
/// If we're no longer interested in the results, we abort the task.
766-
_abort_handle: AbortOnDropAbortHandle,
766+
_abort_handle: AbortOnDropHandle<()>,
767767
/// The result of the background task, eventually.
768768
result: oneshot::Receiver<(PeekResponse, Duration)>,
769769
/// The `tracing::Span` tracking this peek's operation

src/controller/src/clusters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use mz_orchestrator::{
2828
ServiceEvent, ServicePort,
2929
};
3030
use mz_ore::halt;
31-
use mz_ore::task::{AbortOnDropHandle, JoinHandleExt};
31+
use mz_ore::task::AbortOnDropHandle;
3232
use mz_repr::adt::numeric::Numeric;
3333
use mz_repr::GlobalId;
3434
use once_cell::sync::Lazy;

src/environmentd/src/test_util.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ impl<'s, T, H> ConnectBuilder<'s, T, H> {
731731
}
732732
}
733733

734-
/// Configures this [`ConnectBuilder`] to return the [`tokio::task::JoinHandle`] that is
734+
/// Configures this [`ConnectBuilder`] to return the [`mz_ore::task::JoinHandle`] that is
735735
/// polling the underlying postgres connection, associated with the returned client.
736736
pub fn with_handle(self) -> ConnectBuilder<'s, T, WithHandle> {
737737
ConnectBuilder {
@@ -750,37 +750,37 @@ impl<'s, T, H> ConnectBuilder<'s, T, H> {
750750
}
751751
}
752752

753-
/// This trait enables us to either include or omit the [`tokio::task::JoinHandle`] in the result
753+
/// This trait enables us to either include or omit the [`mz_ore::task::JoinHandle`] in the result
754754
/// of a client connection.
755755
pub trait IncludeHandle: Send {
756756
type Output;
757757
fn transform_result(
758758
client: tokio_postgres::Client,
759-
handle: tokio::task::JoinHandle<()>,
759+
handle: mz_ore::task::JoinHandle<()>,
760760
) -> Self::Output;
761761
}
762762

763-
/// Type parameter that denotes we __will not__ return the [`tokio::task::JoinHandle`] in the
763+
/// Type parameter that denotes we __will not__ return the [`mz_ore::task::JoinHandle`] in the
764764
/// result of a [`ConnectBuilder`].
765765
pub struct NoHandle;
766766
impl IncludeHandle for NoHandle {
767767
type Output = tokio_postgres::Client;
768768
fn transform_result(
769769
client: tokio_postgres::Client,
770-
_handle: tokio::task::JoinHandle<()>,
770+
_handle: mz_ore::task::JoinHandle<()>,
771771
) -> Self::Output {
772772
client
773773
}
774774
}
775775

776-
/// Type parameter that denotes we __will__ return the [`tokio::task::JoinHandle`] in the result of
776+
/// Type parameter that denotes we __will__ return the [`mz_ore::task::JoinHandle`] in the result of
777777
/// a [`ConnectBuilder`].
778778
pub struct WithHandle;
779779
impl IncludeHandle for WithHandle {
780-
type Output = (tokio_postgres::Client, tokio::task::JoinHandle<()>);
780+
type Output = (tokio_postgres::Client, mz_ore::task::JoinHandle<()>);
781781
fn transform_result(
782782
client: tokio_postgres::Client,
783-
handle: tokio::task::JoinHandle<()>,
783+
handle: mz_ore::task::JoinHandle<()>,
784784
) -> Self::Output {
785785
(client, handle)
786786
}

src/environmentd/tests/sql.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,11 +1124,9 @@ async fn test_subscribe_shutdown() {
11241124
.unwrap();
11251125

11261126
// Un-gracefully abort the connection.
1127-
conn_task.abort();
1128-
1129-
// Need to await `conn_task` to actually deliver the `abort`. We don't
1127+
// We Need to await `conn_task` to actually deliver the `abort`. We don't
11301128
// care about the result though (it's probably `JoinError` with `is_cancelled` being true).
1131-
let _ = conn_task.await;
1129+
conn_task.abort_and_wait().await;
11321130

11331131
// Dropping the server will initiate a graceful shutdown. We previously had
11341132
// a bug where the server would fail to notice that the client running
@@ -1561,10 +1559,9 @@ async fn test_github_12546() {
15611559
// Aborting the connection should cause its pending queries to be cancelled,
15621560
// allowing the compute instances to stop crashing while trying to execute
15631561
// them.
1564-
conn_task.abort();
1565-
1566-
// Need to await `conn_task` to actually deliver the `abort`.
1567-
let _ = conn_task.await;
1562+
//
1563+
// We need to await `conn_task` to actually deliver the `abort`.
1564+
conn_task.abort_and_wait().await;
15681565

15691566
// Make a new connection to verify the compute instance can now start.
15701567
let client = server.connect().await.unwrap();

src/frontegg-mock/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ use jsonwebtoken::EncodingKey;
8989
use mz_frontegg_auth::{ApiTokenArgs, ApiTokenResponse, Claims, RefreshToken, REFRESH_SUFFIX};
9090
use mz_ore::now::NowFn;
9191
use mz_ore::retry::Retry;
92+
use mz_ore::task::JoinHandle;
9293
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender};
93-
use tokio::task::JoinHandle;
9494
use uuid::Uuid;
9595

9696
pub struct FronteggMockServer {

src/orchestrator-process/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ use mz_ore::cast::{CastFrom, ReinterpretCast, TryCastFrom};
107107
use mz_ore::error::ErrorExt;
108108
use mz_ore::netio::UnixSocketAddr;
109109
use mz_ore::result::ResultExt;
110-
use mz_ore::task::{self, AbortOnDropHandle, JoinHandleExt};
110+
use mz_ore::task::{self, AbortOnDropHandle};
111111
use mz_pid_file::PidFile;
112112
use scopeguard::defer;
113113
use serde::Serialize;

0 commit comments

Comments
 (0)