This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 566ef3d66 Fix multiple part uploads at once making vector size
inconsistent (#2681)
566ef3d66 is described below
commit 566ef3d66a441f4c4fb2ad6654c7039d1f58690d
Author: Marko Grujic <[email protected]>
AuthorDate: Thu Sep 8 11:05:50 2022 +0200
Fix multiple part uploads at once making vector size inconsistent (#2681)
* Fix multiple part uploads at once making vector size inconsistent
* Calculate total_parts prior to resizing the vector
---
object_store/src/multipart.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/object_store/src/multipart.rs b/object_store/src/multipart.rs
index 1985d8694..102d8beda 100644
--- a/object_store/src/multipart.rs
+++ b/object_store/src/multipart.rs
@@ -94,9 +94,9 @@ where
if self.tasks.is_empty() {
return Ok(());
}
- let total_parts = self.completed_parts.len();
while let Poll::Ready(Some(res)) = self.tasks.poll_next_unpin(cx) {
let (part_idx, part) = res?;
+ let total_parts = self.completed_parts.len();
self.completed_parts
.resize(std::cmp::max(part_idx + 1, total_parts), None);
self.completed_parts[part_idx] = Some(part);