Skip to content

Commit 0a00b4c

Browse files
committed
Error context when shutting down already-shut-down durability worker
1 parent 409c5e3 commit 0a00b4c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

crates/core/src/db/durability.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::sync::{
33
Arc,
44
};
55

6+
use anyhow::Context as _;
67
use spacetimedb_commitlog::payload::{
78
txdata::{Mutations, Ops},
89
Txdata,
@@ -114,7 +115,10 @@ impl DurabilityWorker {
114115
/// If [Self::request_durability] is called after [Self::shutdown], the
115116
/// former will panic.
116117
pub async fn shutdown(&self) -> anyhow::Result<TxOffset> {
117-
self.shutdown.send(()).await?;
118+
self.shutdown
119+
.send(())
120+
.await
121+
.context("durability worker already closed")?;
118122
// Wait for the channel to be closed.
119123
self.request_tx.closed().await;
120124
// Load the latest tx offset and wait for it to become durable.

0 commit comments

Comments
 (0)