From 9fb213f47ace4b93fb54386ea52aaaa72871d5c0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 19 Mar 2024 23:51:51 +0200 Subject: feat(tvix/castore): record errors for some failures in SimplePutter This makes it easier to see what's going wrong when uploading multiple Directories. Change-Id: Ieb71424b9761777c5f719b2f365962644de82baf Reviewed-on: https://cl.tvl.fyi/c/depot/+/11209 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/castore/src/directoryservice/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tvix/castore/src/directoryservice/utils.rs b/tvix/castore/src/directoryservice/utils.rs index 341705a8db..52d227d60b 100644 --- a/tvix/castore/src/directoryservice/utils.rs +++ b/tvix/castore/src/directoryservice/utils.rs @@ -7,7 +7,9 @@ use async_stream::stream; use futures::stream::BoxStream; use std::collections::{HashSet, VecDeque}; use tonic::async_trait; +use tracing::instrument; use tracing::warn; +use tracing::Level; /// Traverses a [proto::Directory] from the root to the children. /// @@ -103,6 +105,7 @@ impl SimplePutter { #[async_trait] impl DirectoryPutter for SimplePutter { + #[instrument(skip_all, fields(directory.digest=%directory.digest()), err)] async fn put(&mut self, directory: proto::Directory) -> Result<(), Error> { if self.closed { return Err(Error::StorageError("already closed".to_string())); @@ -116,6 +119,7 @@ impl DirectoryPutter for SimplePutter { Ok(()) } + #[instrument(skip_all, ret(Display, level=Level::TRACE), err)] async fn close(&mut self) -> Result { if self.closed { return Err(Error::StorageError("already closed".to_string())); -- cgit 1.4.1