-
Couldn't load subscription status.
- Fork 81
Fix S3 upload bug #226
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
Fix S3 upload bug #226
Conversation
|
Hi @jessewiles, Thanks for your fixes to the S3 Uploader! We will be freezing the code for the next 7 days or so to stabilise the code for the 1.2.0 release during our Percona Live Europe Conference. I'll review this code after that freeze. |
|
Thanks Tim! For reference, here's the log which provides context for this particular fix. Cheers. https://gist.github.com/jessewiles/79da07545a4dffae96c9d986f3bdb6ae
|
2f9c177 to
4e9fd34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use logging.exception() here instead of importing+using the traceback module? I believe this will arrive at the same result.
https://docs.python.org/3/library/logging.html#logging.Logger.exception
| self.bucket.set_acl(self.s3_acl, key_name) | ||
| except Exception as ex: | ||
| logging.warn("Unable to set ACLs on uploaded key. Exception: {}".format(str(ex))) | ||
| import traceback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use logging.exception() here instead of importing+using the traceback module? I believe this will arrive at the same result.
https://docs.python.org/3/library/logging.html#logging.Logger.exception
|
Done. |
|
Thanks @jessewiles! |
Proposed fix for: #187
This fix has a couple of parts. First, it gets rid of the
get_keycall, which is not necessary for setting the ACL. In our tests, an exception in thisget_keycall caused the entire upload to fail, which is probably NOT the desired result.Secondly, this fix uses the
set_acldirectly on the S3 Bucket object (http://boto.cloudhackers.com/en/latest/ref/s3.html#boto.s3.bucket.Bucket.set_acl). This allows us to avoid the problematicget_keycall.Finally, the exception was blank in our testing. This fix adds an explicit call to
tracebackto help clarify the cause of the error.