about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-17T10·07+0100
committerclbot <clbot@tvl.fyi>2023-10-17T21·12+0000
commit1bb7e84241be81effd7ca57182b2d6edaddc1508 (patch)
treebd0e16dbf43d2fc54bb01b0eb92e5e8517c48913
parent718af22dbba83ddebafdc849eb8645d646a0e163 (diff)
docs(tvix/castore/directorysvc): document drop without put and close r/6850
As seen in cl/9761, we only use put() and close() in some cases.

Make sure this is documented, so we don't end up having implementations
not able to deal with that.

Change-Id: I406ad23f2f4c9604eca731d898ae41a4663fb846
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9786
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
-rw-r--r--tvix/castore/src/directoryservice/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/castore/src/directoryservice/mod.rs b/tvix/castore/src/directoryservice/mod.rs
index 3b26f4baf79b..65beeef4a26c 100644
--- a/tvix/castore/src/directoryservice/mod.rs
+++ b/tvix/castore/src/directoryservice/mod.rs
@@ -58,6 +58,10 @@ pub trait DirectoryService: Send + Sync {
 /// The consumer can periodically call [DirectoryPutter::put], starting from the
 /// leaves. Once the root is reached, [DirectoryPutter::close] can be called to
 /// retrieve the root digest (or an error).
+///
+/// DirectoryPutters might be created without a single [put], and then dropped
+/// without calling [close], for example when ingesting a path that ends up not
+/// pointing to a directory, but a single file or symlink.
 #[async_trait]
 pub trait DirectoryPutter: Send {
     /// Put a individual [proto::Directory] into the store.