-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add retries in activator and envoy timeout to avoid 503's #1226
Add retries in activator and envoy timeout to avoid 503's #1226
Conversation
pkg/controller/route/istio_route.go
Outdated
"github.com/knative/serving/pkg/controller" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const sixtySecondsInMs = "60000" |
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.
change to a generic name like requestTimeoutMs ?
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.
Done.
pkg/controller/route/route_test.go
Outdated
Weight: 0, | ||
}}, | ||
}, getActivatorDestinationWeight(0), | ||
{ |
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 you move this to the previous line gofmt will indent better
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 see. thanks!
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.
Looks good.
/lgtm
/approve
/approve |
pkg/controller/route/route.go
Outdated
} | ||
ret = append(ret, activatorRoute) | ||
} | ||
activatorRoute := RevisionRoute{ |
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.
Please sync with the latest changes as I did the same thing in master branch.
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 copied your change over to avoid merge. :)
pkg/controller/route/route_test.go
Outdated
@@ -339,7 +339,7 @@ func TestCreateRouteCreatesStuff(t *testing.T) { | |||
Namespace: testNamespace, | |||
}, | |||
Weight: 100, | |||
}}, | |||
}, getActivatorDestinationWeight(0)}, |
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.
Please sync this file to the latest in master as well. Some of these changes are there as well.
@@ -29,10 +30,37 @@ import ( | |||
"k8s.io/client-go/rest" | |||
) | |||
|
|||
const ( | |||
maxRetry = 60 |
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.
Seems quite aggressive to retry up to 60 times per request. We should move this to be exponential backoff eventually. We should probably open a Github issue to tackle this later on and check this one in as is.
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.
Ah, Mustafa wondered the same thing as me. I didn't see this before I commented.
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.
cmd/activator/main.go
Outdated
type retryRoundTripper struct{} | ||
|
||
func (rrt retryRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { | ||
transport := http.DefaultTransport.(*http.Transport) |
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.
Why is there a need for this cast?
/lgtm Awesome job :) Just a question (doesn't change my approval), but should we be worried about any backoff to the retries? I don't think so, but I'm just wondering if you've considered it. |
I just resolved the conflict and removed my hold request. Let's check this in and we can address my comments in a later review as they are not blockers. |
The following is the coverage report on pkg/. Say
*TestCoverage feature is being tested, do not rely on any info here yet |
The following is the coverage report on pkg/. Say
*TestCoverage feature is being tested, do not rely on any info here yet |
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akyyy, josephburnett, nikkithurmond, tcnghia, vaikas-google The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #
Since activator uses the revision service name, which doesn't always have the pod ip, we saw 503's and 504's.
Proposed Changes