From 8eb73a5aded822943bdf616bf037397d137ae64f Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 23 Oct 2020 16:04:36 +0200 Subject: [PATCH] workaround executer-blocking-handling-bug in async-std --- src/blob.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/blob.rs b/src/blob.rs index 4abb13fa7c..f6da962f56 100644 --- a/src/blob.rs +++ b/src/blob.rs @@ -63,6 +63,12 @@ impl<'a> BlobObject<'a> { blobname: name.clone(), cause: err.into(), })?; + + // workaround a bug in async-std + // (the executor does not handle blocking operation in Drop correctly, + // see https://github.com/async-rs/async-std/issues/900 ) + let _ = file.flush().await; + let blob = BlobObject { blobdir, name: format!("$BLOBDIR/{}", name), @@ -151,6 +157,10 @@ impl<'a> BlobObject<'a> { cause: err, }); } + + // workaround, see create() for details + let _ = dst_file.flush().await; + let blob = BlobObject { blobdir: context.get_blobdir(), name: format!("$BLOBDIR/{}", name),