diff --git a/file_store/src/file_sink.rs b/file_store/src/file_sink.rs index 773f53425..e02b72a4c 100644 --- a/file_store/src/file_sink.rs +++ b/file_store/src/file_sink.rs @@ -209,7 +209,7 @@ impl FileSinkClient { Err(Error::channel()) } Err(SendTimeoutError::Timeout(_)) => { - tracing::error!("file_sink write failed due to send timeout"); + tracing::error!("file_sink write failed for {:?} due to send timeout", self.metric); Err(Error::SendTimeout) } }, @@ -222,7 +222,10 @@ impl FileSinkClient { .send(Message::Commit(on_commit_tx)) .await .map_err(|e| { - tracing::error!("file_sink failed to commit with {e:?}"); + tracing::error!( + "file_sink failed to commit for {:?} with {e:?}", + self.metric + ); Error::channel() }) .map(|_| on_commit_rx) @@ -234,7 +237,10 @@ impl FileSinkClient { .send(Message::Rollback(on_rollback_tx)) .await .map_err(|e| { - tracing::error!("file_sink failed to rollback with {e:?}"); + tracing::error!( + "file_sink failed to rollback for {:?} with {e:?}", + self.metric + ); Error::channel() }) .map(|_| on_rollback_rx) diff --git a/mobile_verifier/src/coverage.rs b/mobile_verifier/src/coverage.rs index eb71eb7ea..2f2865cd9 100644 --- a/mobile_verifier/src/coverage.rs +++ b/mobile_verifier/src/coverage.rs @@ -124,7 +124,7 @@ impl CoverageDaemon { } } - self.file_sink.commit().await?; + self.file_sink.commit().await?.await??; transaction.commit().await?; Ok(()) diff --git a/mobile_verifier/src/heartbeats/wifi.rs b/mobile_verifier/src/heartbeats/wifi.rs index bf75e717e..5227ca01a 100644 --- a/mobile_verifier/src/heartbeats/wifi.rs +++ b/mobile_verifier/src/heartbeats/wifi.rs @@ -124,9 +124,19 @@ where &mut transaction, ) .await?; - self.heartbeat_sink.commit().await?; - self.seniority_sink.commit().await?; + // Ensure that we have committed our work: + tokio::try_join!(self.commit_heartbeat_sink(), self.commit_seniority_sink())?; transaction.commit().await?; Ok(()) } + + async fn commit_heartbeat_sink(&self) -> anyhow::Result<()> { + self.heartbeat_sink.commit().await?.await??; + Ok(()) + } + + async fn commit_seniority_sink(&self) -> anyhow::Result<()> { + self.seniority_sink.commit().await?.await??; + Ok(()) + } }