Skip to content
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

Make panic threshold configurable for cluster #5118

Merged
merged 10 commits into from
Feb 2, 2025

Conversation

nezdolik
Copy link
Member

@nezdolik nezdolik commented Jan 21, 2025

feat(api): Make panic threshold configurable per backend/cluster
Fixes #4015

Release Notes: TBD

@nezdolik nezdolik requested a review from a team as a code owner January 21, 2025 11:47

if policy.Spec.CommonLbSettings != nil {
if lbSettings, err = buildCommonLbSettings(policy.Spec.CommonLbSettings); err != nil {
err = perr.WithMessage(err, "RateLimit")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oopsie

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.90%. Comparing base (3b18afe) to head (eb1631f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5118      +/-   ##
==========================================
+ Coverage   66.81%   66.90%   +0.08%     
==========================================
  Files         210      210              
  Lines       32988    32998      +10     
==========================================
+ Hits        22042    22077      +35     
+ Misses       9604     9583      -21     
+ Partials     1342     1338       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -579,6 +579,22 @@ type ClusterSettings struct {
//
// +optional
HTTP2 *HTTP2Settings `json:"http2,omitempty"`

Copy link
Contributor

@arkodg arkodg Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my preference would be to add a PanicThreshold unit32 field inside HealthCheck supporting values between 0-100

type HealthCheck struct {

@arkodg arkodg modified the milestones: v1.3.0, v1.3.0-rc.1, Backlog Jan 21, 2025
@@ -2456,6 +2459,12 @@ func (h *HealthCheck) Validate() error {
}
}

if h.PanicThreshold != nil {
if *h.PanicThreshold < 0 || *h.PanicThreshold > 100 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

realistically it cannot be < 0 due to uint32 type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: internal/ir/xds.go:2463:6: SA4003: no value of type uint32 is less than 0 (staticcheck)
		if *h.PanicThreshold < 0 || *h.PanicThreshold > 100 {

CI is smart :)

@@ -1421,6 +1439,7 @@ func TestValidateHealthCheck(t *testing.T) {
},
},
&OutlierDetection{},
ptr.To[uint32](10),
Copy link
Member Author

@nezdolik nezdolik Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should be able just to set it to nil

@nezdolik nezdolik requested a review from arkodg January 23, 2025 15:23
@nezdolik
Copy link
Member Author

there is a failure for conformance test --- FAIL: TestGatewayAPIConformance/HTTPRouteListenerPortMatching (72.08s) with not much additional info

arkodg
arkodg previously approved these changes Jan 23, 2025
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arkodg arkodg requested review from a team January 23, 2025 16:18
@arkodg arkodg modified the milestones: Backlog, v1.3.0-rc.1 Jan 23, 2025
@arkodg arkodg modified the milestones: v1.3.0-rc.1, Backlog Jan 23, 2025
shawnh2
shawnh2 previously approved these changes Jan 28, 2025
Copy link
Contributor

@shawnh2 shawnh2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -106,6 +107,13 @@ func buildXdsCluster(args *xdsClusterArgs) *clusterv3.Cluster {
PerConnectionBufferLimitBytes: buildBackandConnectionBufferLimitBytes(args.backendConnection),
}

// 50% is the Envoy default value for panic threshold. No need to explicitly set it in this case.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this set twice - here and below ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, error while refactoring

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team January 31, 2025 18:03
Copy link
Member

@zirain zirain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it would be better if you can add an e2e for this later.

Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
Signed-off-by: Kateryna Nezdolii <[email protected]>
@zirain zirain force-pushed the 4015-panic-threshold branch from a0de321 to eb1631f Compare February 2, 2025 03:08
@zirain zirain merged commit fcc458a into envoyproxy:main Feb 2, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic threshold to be configurable
4 participants