-
Notifications
You must be signed in to change notification settings - Fork 615
[apiserver] Add retry and timeout to apiserver V2 #3869
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
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f76b6b9
feat: add retry and timeout to apiserver V2
kenchung285 430f429
feat: add logs to failure retries
kenchung285 d0cab52
ensure timeout duration and retryable status codes consistent with ap…
kenchung285 043d99b
refactor comments
kenchung285 4807020
merge body preserving into retryRoundTripper
kenchung285 5949d16
add todo comment for v1 v2 compatibility
kenchung285 501975d
feat: drain response every time before retry
kenchung285 440730e
add TODO comment for merging common utils in v1 and v2
kenchung285 a10c8f5
test: add mock test for retry round tripper
kenchung285 08da214
Add comment for retryRoundTripper mock unit test
kenchung285 37e885b
feat: improve error log
kenchung285 73d7592
test: add more test for retryRoundTripper && fix minor errors
kenchung285 b7d776f
minor: format
kenchung285 5cffede
improve error message
kenchung285 5c1b1dd
renaming function
kenchung285 3c60df2
add todo comment for http util funtions
kenchung285 31129fc
fix: retry times error && add comments for clarity
kenchung285 501a64f
return timeout error for remaining time less than the backoff sleep d…
kenchung285 b783d41
refactor && use select to prevent blocking if the request context bei…
kenchung285 d2a3b72
refactor: avoid using req.GetBody in reusing request body
kenchung285 2d73386
update
kenchung285 2a0e301
Update apiserversdk/proxy.go
kenchung285 515ccdc
test: add a test for request with body
kenchung285 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package apiserversdk | ||
|
||
import "time" | ||
|
||
// TODO: Make apiserver configs compatible with V1 | ||
const ( | ||
// Max retry times for HTTP Client | ||
HTTPClientDefaultMaxRetry = 3 | ||
|
||
// Retry backoff settings | ||
HTTPClientDefaultBackoffBase = float64(2) | ||
HTTPClientDefaultInitBackoff = 500 * time.Millisecond | ||
HTTPClientDefaultMaxBackoff = 10 * time.Second | ||
|
||
// Overall timeout for retries | ||
HTTPClientDefaultOverallTimeout = 30 * time.Second | ||
) |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.