Skip to content

Commit

Permalink
Merge pull request #2040 from deltachat/workaround-spawned-tasks
Browse files Browse the repository at this point in the history
workaround executer-blocking-handling bug
  • Loading branch information
r10s authored Oct 23, 2020
2 parents e6b7a7e + 8eb73a5 commit 0781316
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 0781316

Please sign in to comment.