-
Notifications
You must be signed in to change notification settings - Fork 200
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
SG-35712 Prevent flaky disconnection when uploading thumbnails on publish #368
base: master
Are you sure you want to change the base?
Conversation
@@ -4330,13 +4330,13 @@ def connect(self): | |||
) | |||
|
|||
|
|||
class CACertsHTTPSHandler(urllib.request.HTTPSHandler): | |||
class CACertsHTTPSHandler(urllib.request.HTTPHandler): |
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.
Why do we need this change?
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 have a clear answer for this. I was a trial/error change that made sense to me according to keep consistency on naming. Also, we're using SSL with TLS.
|
||
attempt = 1 | ||
while attempt <= self.MAX_ATTEMPTS: | ||
# Perform the request | ||
try: | ||
opener = self._build_opener(FormPostHandler) |
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.
Side question: why don't we use httplib2 for those?
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'm not sure how to answer this. This line was moved from outside the retry block, so in case it fails, the retry can start a new connection. I don't know the details of the original design.
There's a flaky disconnection when the publisher uploads the thumbnail. The most common errors are:
They seem to be related to TLS handshakes. While testing on local machines we consistently reproduced this with the following change: Move the connection opener to the retry block and change
CACertsHTTPSHandler
parent class.