-
Notifications
You must be signed in to change notification settings - Fork 54
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
Limit per-host concurrency and add retries #217
base: master
Are you sure you want to change the base?
Limit per-host concurrency and add retries #217
Conversation
Configuration minimizes impact of retries
63c5f1b
to
503aa92
Compare
@@ -280,6 +275,39 @@ func (hT *HTMLTest) checkExternal(ref *htmldoc.Reference) { | |||
// TODO check a hash id exists in external page if present in reference (URL.Fragment) | |||
} | |||
|
|||
var hostChannelsLock sync.Mutex // Lock used to prevent concurrent updates to hostChannels |
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 initially added this as a member of HTMLTest
but that in turn required setRedirectLimitCheck()
to be modified by passing a reference instead of a value; this broke redirection tests by increasing the number of issues found from 1
to 2
.
Making this a global is slightly suboptimal, but seemed to be a reasonable compromise. Happy to move it back into HTMLTest
if that's a better spot for it to live.
Limits the number of concurrent requests to a single host in order to reduce (hopefully to eliminate) errors where the server objects. Also adds automatic retries (with exponential backoff) to further mitigate transient errors.
Partial mitigation of #152.
Closes #103
Closes #25
The introduction of retries has required update of the VCR recordings; the actual changes are fairly limited in scope - I deliberately chose
retryablehttp
because it was a near seamless drop in replacement.Marked as draft because too many commits have been pulled in by Github.Fixed by rebasing this PR. Might have conflicts if #215 is merged first; I'll remedy those if that happens.