Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup incomplete upload upon error #599

Merged
merged 1 commit into from Dec 8, 2017
Merged

Conversation

harshavardhana
Copy link
Member

Since we do not have resuming support, we should
simply cleanup failed transfers.

minio/api.py Outdated
@@ -1524,7 +1524,8 @@ def _stream_put_object(self, bucket_name, object_name,

part_data = read_full(data, current_part_size)
# Append current part information
parts_to_upload.append((bucket_name, object_name, upload_id, part_number, part_data))
parts_to_upload.append((bucket_name, object_name, upload_id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this just a formatting change?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep!

Copy link
Collaborator

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

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

LGTM

minio/api.py Outdated
@@ -1524,7 +1524,8 @@ def _stream_put_object(self, bucket_name, object_name,

part_data = read_full(data, current_part_size)
# Append current part information
parts_to_upload.append((bucket_name, object_name, upload_id, part_number, part_data))
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)
Copy link
Member

Choose a reason for hiding this comment

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

pool.parallel_run() can raise an exception, I think it would be good to catch it, remove incomplete upload and throw the exception again.

try:
     pool.parallel_run(self._upload_part_routine, parts_to_upload)
except:
     self._remove_incomplete_upload(bucket_name,
                                           object_name,
                                           upload_id)
     raise

Copy link
Member Author

Choose a reason for hiding this comment

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

done

minio/api.py Outdated
self._remove_incomplete_upload(bucket_name,
object_name,
upload_id)

Copy link
Member

Choose a reason for hiding this comment

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

A missing raise 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.

done

Since we do not have resuming support, we should
simply cleanup failed transfers.
Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

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

LGTM

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.

@deekoder deekoder merged commit f1130fd into minio:master Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants