about summary refs log tree commit diff
path: root/tvix/castore/src
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-19T21·51+0200
committerclbot <clbot@tvl.fyi>2024-03-20T12·21+0000
commit9fb213f47ace4b93fb54386ea52aaaa72871d5c0 (patch)
tree4705e45d4e9704927df378d2d1aad9548e1ce77f /tvix/castore/src
parent283c3f0de4142157a8ea089d78eb11d2d439c28a (diff)
feat(tvix/castore): record errors for some failures in SimplePutter r/7753
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 <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/castore/src')
-rw-r--r--tvix/castore/src/directoryservice/utils.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/castore/src/directoryservice/utils.rs b/tvix/castore/src/directoryservice/utils.rs
index 341705a8db9f..52d227d60b59 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<DS: DirectoryService> SimplePutter<DS> {
 
 #[async_trait]
 impl<DS: DirectoryService + 'static> DirectoryPutter for SimplePutter<DS> {
+    #[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<DS: DirectoryService + 'static> DirectoryPutter for SimplePutter<DS> {
         Ok(())
     }
 
+    #[instrument(skip_all, ret(Display, level=Level::TRACE), err)]
     async fn close(&mut self) -> Result<B3Digest, Error> {
         if self.closed {
             return Err(Error::StorageError("already closed".to_string()));