-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add context/timeout to HTTP throttle check #1131
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
Merged
timvaillancourt
merged 21 commits into
github:master
from
timvaillancourt:throttle-http-context
Jul 6, 2022
Merged
Add context/timeout to HTTP throttle check #1131
timvaillancourt
merged 21 commits into
github:master
from
timvaillancourt:throttle-http-context
Jul 6, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
approved these changes
Jul 6, 2022
ghost
pushed a commit
that referenced
this pull request
Jul 7, 2022
* Add context/timeout to HTTP throttle check * Dont run `.GetThrottleHTTPInterval()` on every loop * Update help message * Var rename * 2022 * Add timeout flag * Add unix/tcp server commands, use ParseInt() for string->int64 * Var rename * Re-check http timeout on every loop iteration * Remove stale comment * Make throttle interval idempotent * var rename * Usage grammar * Make http timeout idempotent too * Parse time.Duration once * Move timeout to NewThrottler * Help update * Set User-Agent header * Re-add newline Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
Closed
ghost
pushed a commit
that referenced
this pull request
Jul 7, 2022
* Add context/timeout to HTTP throttle check * Dont run `.GetThrottleHTTPInterval()` on every loop * Update help message * Var rename * 2022 * Add timeout flag * Add unix/tcp server commands, use ParseInt() for string->int64 * Var rename * Re-check http timeout on every loop iteration * Remove stale comment * Make throttle interval idempotent * var rename * Usage grammar * Make http timeout idempotent too * Parse time.Duration once * Move timeout to NewThrottler * Help update * Set User-Agent header * Re-add newline Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
RainbowDashy
pushed a commit
to RainbowDashy/gh-ost
that referenced
this pull request
Jul 11, 2022
* Add context/timeout to HTTP throttle check * Dont run `.GetThrottleHTTPInterval()` on every loop * Update help message * Var rename * 2022 * Add timeout flag * Add unix/tcp server commands, use ParseInt() for string->int64 * Var rename * Re-check http timeout on every loop iteration * Remove stale comment * Make throttle interval idempotent * var rename * Usage grammar * Make http timeout idempotent too * Parse time.Duration once * Move timeout to NewThrottler * Help update * Set User-Agent header * Re-add newline Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
Closed
timvaillancourt
added a commit
to timvaillancourt/gh-ost
that referenced
this pull request
Aug 10, 2022
2 tasks
timvaillancourt
added a commit
that referenced
this pull request
Aug 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves issue: #1130
Description
This PR passes a
context.Contextto thenet/httpclient ingo/logic/throttler.goto address the lack of a timeout in the HTTP-based throttler. Also theUser-Agentheader is now set togh-ost/VERSION(eggh-ost/1.1.4for version 1.1.4) instead of thenet/httpdefaultThis fix will prevent HTTP-throttler blocking infinitely when the HTTP throttler source is slow to respond
This PR also enables the
noctxlinter in CI jobs so we can catch code that could use a context in the futureAlso the previously-hardcoded (100ms) check interval for the HTTP-throttler was moved to the command-line flag
--throttle-http-interval-millis(default 100). The timeout value for the HTTP check is controlled with--throttle-http-timeout-millis(default 1000)script/cibuildreturns with no formatting errors, build errors or unit test errors.