Skip to content

Commit 3901a23

Browse files
committed
Switch the error handling approach in Tasked
The old one is causing errors in sqllogictest. It's possible this is because we're not yielding to the relevant runtime for a particular task? But anyways we're ambivalent about the error handling strategy here, so let's just raise things up.
1 parent c32567b commit 3901a23

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/persist/src/location.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use async_trait::async_trait;
1818
use bytes::Bytes;
1919
use mz_ore::bytes::SegmentedBytes;
2020
use mz_ore::cast::u64_to_usize;
21-
use mz_ore::task::JoinHandleExt;
2221
use mz_proto::RustType;
2322
use proptest_derive::Arbitrary;
2423
use serde::{Deserialize, Serialize};
@@ -395,8 +394,7 @@ impl<A: Consensus + Sync + Send + 'static> Consensus for Tasked<A> {
395394
|| "persist::task::head",
396395
async move { backing.head(&key).await },
397396
)
398-
.wait_and_assert_finished()
399-
.await
397+
.await?
400398
}
401399

402400
async fn compare_and_set(
@@ -410,8 +408,7 @@ impl<A: Consensus + Sync + Send + 'static> Consensus for Tasked<A> {
410408
mz_ore::task::spawn(|| "persist::task::cas", async move {
411409
backing.compare_and_set(&key, expected, new).await
412410
})
413-
.wait_and_assert_finished()
414-
.await
411+
.await?
415412
}
416413

417414
async fn scan(
@@ -425,8 +422,7 @@ impl<A: Consensus + Sync + Send + 'static> Consensus for Tasked<A> {
425422
mz_ore::task::spawn(|| "persist::task::scan", async move {
426423
backing.scan(&key, from, limit).await
427424
})
428-
.wait_and_assert_finished()
429-
.await
425+
.await?
430426
}
431427

432428
async fn truncate(&self, key: &str, seqno: SeqNo) -> Result<usize, ExternalError> {
@@ -435,8 +431,7 @@ impl<A: Consensus + Sync + Send + 'static> Consensus for Tasked<A> {
435431
mz_ore::task::spawn(|| "persist::task::truncate", async move {
436432
backing.truncate(&key, seqno).await
437433
})
438-
.wait_and_assert_finished()
439-
.await
434+
.await?
440435
}
441436
}
442437

0 commit comments

Comments
 (0)