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

xds: fix support for circuit breakers in LOGICAL_DNS clusters #8169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dfawley
Copy link
Member

@dfawley dfawley commented Mar 13, 2025

Previously this setting was only plumbed to EDS, which meant it didn't apply to LOGICAL_DNS, but it should apply to both.

RELEASE NOTES:

  • xds: fix support for circuit breakers in LOGICAL_DNS clusters

@dfawley dfawley added this to the 1.72 Release milestone Mar 13, 2025
@dfawley dfawley requested a review from purnesh42H March 13, 2025 18:28
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.08%. Comparing base (775150f) to head (f527755).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8169      +/-   ##
==========================================
- Coverage   82.25%   82.08%   -0.18%     
==========================================
  Files         393      410      +17     
  Lines       39143    40253    +1110     
==========================================
+ Hits        32197    33040     +843     
- Misses       5616     5851     +235     
- Partials     1330     1362      +32     
Files with missing lines Coverage Δ
xds/internal/balancer/cdsbalancer/cdsbalancer.go 84.59% <100.00%> (+0.03%) ⬆️
...internal/balancer/clusterresolver/configbuilder.go 91.12% <100.00%> (+0.05%) ⬆️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

func (s) TestCircuitBreaking(t *testing.T) {
const maxRequests = 3
// Create an xDS management server that serves ADS and LRS requests.
mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{SupportLoadReportingService: true})
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do we need to server LRS for this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. This was copy/pasted from another test that probably did.

@@ -354,3 +357,213 @@ func waitForSuccessfulLoadReport(ctx context.Context, lrsServer *fakeserver.Serv
}
}
}

func (s) TestCircuitBreaking(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add docstring?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done


// Configure the xDS management server with default resources. Override the
// default cluster to include an LRS server config pointing to self.
const serviceName = "my-test-xds-service"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: similar to maxRequests, serviceName can be declared at the start as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved maxRequests here instead.

return
}
if err == nil {
stream.CloseSend()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: may be comment saying we are closing unintended new streams?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

t.Fatalf("RPCs unexpectedly allowed beyond circuit breaking maximum")
}

func (s) TestCircuitBreakingLogicalDNS(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add docstring for this as well explaining what the test is verifying

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

func (s) TestCircuitBreakingLogicalDNS(t *testing.T) {
const maxRequests = 3
// Create an xDS management server that serves ADS and LRS requests.
mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{SupportLoadReportingService: true})
Copy link
Contributor

Choose a reason for hiding this comment

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

same. Do we need LRS for this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

host, port := hostAndPortFromAddress(t, server.Address)

// Configure the xDS management server with default resources. Override the
// default cluster to include an LRS server config pointing to self.
Copy link
Contributor

Choose a reason for hiding this comment

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

default cluster to include an LRS server config pointing to self.

not LRS server. Comment should mention CircuitBreakers ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@purnesh42H purnesh42H assigned dfawley and unassigned purnesh42H Mar 18, 2025
@dfawley
Copy link
Member Author

dfawley commented Mar 18, 2025

Thanks, PTAL

@dfawley dfawley assigned purnesh42H and unassigned dfawley Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants