-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Correctly handle TooManyBuckets error_code in default_bucket method #40
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
Conversation
Correctly handles the `TooManyBuckets` error_code when the bucket already exists.
TooManyBuckets
error_code in default_bucket
TooManyBuckets
error_code in default_bucket
method
TooManyBuckets
error_code in default_bucket
methodThere 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.
Thanks for your submission!
This looks good to me.
src/sagemaker/session.py
Outdated
elif error_code == 'TooManyBuckets': | ||
try: | ||
s3.meta.client.head_bucket(Bucket=default_bucket) | ||
LOGGER.info('S3 bucket {} already exists'.format( |
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.
I don't think we need this logging message, in the normal case we don't log this.
src/sagemaker/session.py
Outdated
@@ -170,6 +170,14 @@ def default_bucket(self): | |||
elif error_code == 'OperationAborted' and 'conflicting conditional operation' in message: | |||
# If this bucket is already being concurrently created, we don't need to create it again. | |||
pass | |||
elif error_code == 'TooManyBuckets': | |||
try: | |||
s3.meta.client.head_bucket(Bucket=default_bucket) |
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.
This is a little esoteric - if we remove the logging below, can you add some developer documentation:
# Succeed if the default bucket exists
Remove logging message
@owen-t Addressed your comments above. |
Is there something I need to amend due to the failing |
Hello, |
removing references to auto-scaling
Merge pull request aws#40 from athewsey/feat/fw-processor
At my organisation we have reached our maximum number of allowed buckets on
s3
and as a direct consequence of that we started getting the following error when using thesagemaker-python-sdk
:This little patch seems to take care of this issue.
I could not find much information in terms of the expected PR structure so I hope this suffices, happy to make the pertinent changes if it does not.