Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,15 @@ def _stream_put_object(self, bucket_name, object_name,
parts_to_upload.append((bucket_name, object_name, upload_id, part_number, part_data))

# Run parts upload in parallel
pool.parallel_run(self._upload_part_routine, parts_to_upload)
try:
pool.parallel_run(self._upload_part_routine, parts_to_upload)
except:
# Any exception that occurs sends an abort on the
# on-going multipart operation.
self._remove_incomplete_upload(bucket_name,
object_name,
upload_id)
raise

# Update uploaded_parts with the part uploads result
# and check total uploaded data.
Expand All @@ -1546,14 +1554,28 @@ def _stream_put_object(self, bucket_name, object_name,
if total_uploaded != content_size:
msg = 'Data uploaded {0} is not equal input size ' \
'{1}'.format(total_uploaded, content_size)
# cleanup incomplete upload upon incorrect upload
# automatically
self._remove_incomplete_upload(bucket_name,
object_name,
upload_id)
raise InvalidSizeError(msg)

# Complete all multipart transactions if possible.
mpart_result = self._complete_multipart_upload(bucket_name,
object_name,
upload_id,
uploaded_parts,
metadata=metadata)
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is formatting issue here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't see any issue, if there is a formatting issue python won't really compile.

mpart_result = self._complete_multipart_upload(bucket_name,
object_name,
upload_id,
uploaded_parts,
metadata=metadata)
except:
# Any exception that occurs sends an abort on the
# on-going multipart operation.
self._remove_incomplete_upload(bucket_name,
object_name,
upload_id)
raise

# Return etag here.
return mpart_result.etag

Expand Down