-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
🚀 New features to boost your workflow:
|
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}) |
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.
nit: Do we need to server LRS for this test?
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.
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) { |
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.
Add docstring?
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
|
||
// 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" |
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.
nit: similar to maxRequests, serviceName
can be declared at the start as well?
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.
Moved maxRequests here instead.
return | ||
} | ||
if err == nil { | ||
stream.CloseSend() |
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.
nit: may be comment saying we are closing unintended new streams?
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
t.Fatalf("RPCs unexpectedly allowed beyond circuit breaking maximum") | ||
} | ||
|
||
func (s) TestCircuitBreakingLogicalDNS(t *testing.T) { |
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.
Add docstring for this as well explaining what the test is verifying
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
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}) |
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.
same. Do we need LRS for this test?
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
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. |
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.
default cluster to include an LRS server config pointing to self.
not LRS server. Comment should mention CircuitBreakers ?
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
Thanks, PTAL |
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: