-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: Detect connection failures forwarded from warcprox and retry th… #285
base: master
Are you sure you want to change the base?
Conversation
Brozzler didn't really have a retry loop for failed pages except when connection to warcprox failed, and this too would fail in a tight loop. Warcprox connection failures and timeouts are returned to the browser as 502 and 504 status codes, so I'm checking for those and adding a retry loop with backoff. This is accomplished by adding a |
retry_delay = min(60, 60 * (1.5**page.failed_attempts)) | ||
page.retry_after = doublethink.utcnow() + datetime.timedelta( | ||
seconds=retry_delay | ||
) | ||
page.failed_attempts = (page.failed_attempts or 0) + 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.
If we're setting this in populate_defaults we don't need to have a default here
…em with backoff