Skip to content

Commit

Permalink
fix meta_receiver bug possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Nov 11, 2024
1 parent b3bf149 commit d386e1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion aws-s3-transfer-manager/src/operation/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ async fn send_discovery(
}

// acquire a permit for discovery
// TODO: Verify, if this fails we are not stuck.
let permit = ctx.handle.scheduler.acquire_permit().await?;

// make initial discovery about the object size, metadata, possibly first chunk
Expand Down
5 changes: 4 additions & 1 deletion aws-s3-transfer-manager/src/operation/download/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ impl DownloadHandle {
.object_meta
.get_or_try_init(|| async {
let mut object_meta_receiver = self.object_meta_receiver.lock().await;
let object_meta_receiver = object_meta_receiver.take().unwrap();
let object_meta_receiver = object_meta_receiver
.take()
.ok_or("meta_receiver is already taken")
.map_err(error::from_kind(ErrorKind::ObjectNotDiscoverable))?;
object_meta_receiver
.await
.map_err(error::from_kind(ErrorKind::ObjectNotDiscoverable))
Expand Down

0 comments on commit d386e1d

Please sign in to comment.