Repository navigation
Prepare queue healthHandler for optional aggressive retries - #4649
Conversation
Co-authored-by: Shash Reddy <[email protected]>
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
knative-prow-robot
left a comment
There was a problem hiding this comment.
@joshrider: 1 warning.
Details
In response to this:
Co-authored-by: Shash Reddy [email protected]
Support #4014
One of many parts, spun out from #4600Proposed Changes
- Update queue health package to include TCP and HTTP retries and pave way for user-defined readinessProbes from the queue-proxy.
- Following PRs will use this package.
Release Note
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Co-authored-by: Shash Reddy <[email protected]>
| }, | ||
| Timeout: config.Timeout, | ||
| } | ||
| url := fmt.Sprintf("%s://%s:%d%s", config.Scheme, config.Host, config.Port.IntValue(), config.Path) |
There was a problem hiding this comment.
Why not construct url.URL object and then use its String method?
There was a problem hiding this comment.
If we build url.URL object then would we end up with something like below
url := url.URL{
Scheme: fmt.Sprintf("%s", config.Scheme),
Host: fmt.Sprintf("%s:%d", config.Host, config.Port.IntValue()),
Path: config.Path,
}
Not sure if we gain anything by making building URL object.
There was a problem hiding this comment.
Well:
- Scheme can be just assigned (no need to sprintf)
- Host is just
config.Host + ":" + config.Port.String()(no need to sprintf) - you don't have to deal with validating slashes "/" (you don't currently, so in fact a wrong URL can be built)
There was a problem hiding this comment.
Scheme can be just assigned (no need to sprintf)
config.Scheme is not string type so that needs to be converted.
I agree with the rest so I will update
There was a problem hiding this comment.
URIScheme is string alias. So just string(config.Scheme) will do.
|
@vagababov : Addressed your comments. Ready for another review 👍 |
| } | ||
|
|
||
| if !IsHTTPProbeReady(res) { | ||
| return errors.New("HTTP probe did not respond Ready") |
There was a problem hiding this comment.
Feels like this should include the status code 🤔
vagababov
left a comment
There was a problem hiding this comment.
Mostly cosmetic from me.
|
|
||
| switch { | ||
| case h.IsAlive(): | ||
| case isNotAggressive && h.IsAlive(): |
There was a problem hiding this comment.
I kind of envisioned the change to be !isAggressive here. But I guess this works also :)
There was a problem hiding this comment.
will brainstorm a more descriptive name and update in future 🤔
| mux := http.NewServeMux() | ||
| mux.HandleFunc(requestQueueHealthPath, healthState.HealthHandler(probeUserContainer)) | ||
| // TODO(@joshrider): temporary change while waiting on other PRs to merge (See #4014) | ||
| mux.HandleFunc(requestQueueHealthPath, healthState.HealthHandler(probeUserContainer, true /*isNotAggressive is set to true to piggyback on previous success and not aggressively retry everytime*/)) |
There was a problem hiding this comment.
| mux.HandleFunc(requestQueueHealthPath, healthState.HealthHandler(probeUserContainer, true /*isNotAggressive is set to true to piggyback on previous success and not aggressively retry everytime*/)) | |
| mux.HandleFunc(requestQueueHealthPath, healthState.HealthHandler(probeUserContainer, true /*isNotAggressive*/)) |
| Timeout: config.Timeout, | ||
| } | ||
| url := url.URL{ | ||
| Scheme: fmt.Sprintf("%s", config.Scheme), |
There was a problem hiding this comment.
| Scheme: fmt.Sprintf("%s", config.Scheme), | |
| Scheme: string(config.Scheme), |
mattmoor
left a comment
There was a problem hiding this comment.
Couple comments still inline seem relevant
|
On the case 👍 |
Co-authored-by: Shash Reddy <[email protected]>
|
The following is the coverage report on pkg/.
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joshrider, mattmoor The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
Co-authored-by: Shash Reddy [email protected]
Support #4014
One of many parts, spun out from #4600
Proposed Changes
Release Note