Skip to content

Commit 566ef3d

Browse files
authored
Fix multiple part uploads at once making vector size inconsistent (apache#2681)
* Fix multiple part uploads at once making vector size inconsistent * Calculate total_parts prior to resizing the vector
1 parent 0b59f05 commit 566ef3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

object_store/src/multipart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ where
9494
if self.tasks.is_empty() {
9595
return Ok(());
9696
}
97-
let total_parts = self.completed_parts.len();
9897
while let Poll::Ready(Some(res)) = self.tasks.poll_next_unpin(cx) {
9998
let (part_idx, part) = res?;
99+
let total_parts = self.completed_parts.len();
100100
self.completed_parts
101101
.resize(std::cmp::max(part_idx + 1, total_parts), None);
102102
self.completed_parts[part_idx] = Some(part);

0 commit comments

Comments
 (0)