-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[ACR] Fix#16700: Use "exists" api to check storage blob existence #17299
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
rosanch
left a comment
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.
LGTM
| if log_exist: | ||
| props = blob_service.get_blob_properties( | ||
| container_name=container_name, blob_name=blob_name) | ||
| metadata = props.metadata |
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.
@northtyphoon can props be null?
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.
no, it will throw error like AureHttpError, in that case, we will retry or just exit if the code doesn't know how to handle it
| available = props.properties.content_length | ||
| else: | ||
| # Wait a little bit before checking the existence again | ||
| time.sleep(1) |
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.
where does it retry after sleep?
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.
the code will continue to the loop, since log_exists is false in this case, it will execute L158-159 to check the existence again
Description
This pr is to fix #16700
Testing Guide
az acr build --cmd "docker images" /dev/null
before the fix, the command may output BlobNotFound error sometimes.
after the fix, the command will not output BlobNotFound error.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.