-
Notifications
You must be signed in to change notification settings - Fork 68
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
[SYNPY-1514] Handle Expired Pre-Signed URLs #1126
[SYNPY-1514] Handle Expired Pre-Signed URLs #1126
Conversation
Hello @BWMac! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-09-03 22:11:44 UTC |
There was also an SSL exception that was in the logs the user had provided. Can you also see if we can add that to the exceptions that are retried? |
@BryanFauble We definitely could, but as written my solution to the 403 response codes is to check if the URL is expired and then if it is, retry. Will the URL also be expired in the case where |
I don't think a 403 is going to be raised. I think the solution is to add it to the standard retry params: synapsePythonClient/synapseclient/client.py Line 190 in 2dda954
In the retry function you can also pass the actual exception class too. I think we will want to add it as one of the things to retry, just like the connection exceptions that are raised. That way the ssl errors are treated with the same 5 minute retry logic. |
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.
Great changes! Just a few small areas that changes could be made, but shouldn't affect overall intention of the code.
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!
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! This is neat, although the exception handling definitely looks more complex now.
Problem:
Due to the unordered nature of AsyncIO executing tasks async, when there is a large queue of files to download, the file may not be downloaded for a while after a pre-signed URL is retrieved. This shows up as a
403 Forbidden
error which needs to be handled for these cases to prevent downloads from failing.Solution:
Update
download_from_url
to handle these403
responses and try again by checking if the URL is expired when we receive a 403 response code, retrieving a new URL and retrying the download.Testing:
random
package to have this failure occur.synapse get
CLI command