-
Notifications
You must be signed in to change notification settings - Fork 4.6k
xds: Fix xDS Server in the case of dynamic RDS #6889
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
Changes from all commits
5600ccf
0e880df
8e07bca
7fc9318
d8c9951
1c57f65
d06c976
6a923b2
bb47b5c
c90d542
1a67264
6178f08
71af2a7
0480b85
7348bc9
eb0fab9
ea47cd6
3d35b6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1288,6 +1288,11 @@ func (t *http2Server) closeStream(s *Stream, rst bool, rstCode http2.ErrCode, eo | |
| }) | ||
| } | ||
|
|
||
| // CallbackConn is a conn with a callback function. | ||
| type CallbackConn interface { | ||
| Callback(ServerTransport) | ||
| } | ||
|
Comment on lines
+1291
to
+1294
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See: go/go-style/decisions#interfaces Why does this interface have to be defined in the Also, this interface is utterly underspecified. It does not explain any of the following:
From the PR description: I don't see the problem with the existing approach of draining server transports that this new method overcomes.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method guarantees synchornization between the Conns closing, and a new Conn being accepted. Previously, there was no way in the case you yielded thread after an Accept and synchronized with the possibility of a new Conn being added to the map, so it races. This guarantees synchronization between those components. Will document this further. (You don't have the server transport object until it wraps the accepted conn with the http2_server, so we were doing it wrong). Previously, the server would drain all the conns. |
||
|
|
||
| func (t *http2Server) Drain(debugData string) { | ||
| t.mu.Lock() | ||
| defer t.mu.Unlock() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ package xds_test | |
| import ( | ||
| "context" | ||
| "fmt" | ||
| "io" | ||
| "net" | ||
| "strconv" | ||
| "testing" | ||
|
|
@@ -50,6 +51,15 @@ func (*testService) UnaryCall(context.Context, *testpb.SimpleRequest) (*testpb.S | |
| return &testpb.SimpleResponse{}, nil | ||
| } | ||
|
|
||
| func (*testService) FullDuplexCall(stream testgrpc.TestService_FullDuplexCallServer) error { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I don't get what you're saying here. |
||
| for { | ||
| _, err := stream.Recv() // hangs here forever if stream doesn't shut down...doesn't receive EOF without any errors | ||
| if err == io.EOF { | ||
| return nil | ||
| } | ||
| } | ||
| } | ||
|
|
||
| func testModeChangeServerOption(t *testing.T) grpc.ServerOption { | ||
| // Create a server option to get notified about serving mode changes. We don't | ||
| // do anything other than throwing a log entry here. But this is required, | ||
|
|
||
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.
Existing function
DefaultServerListenercallsdefaultServerListenerCommonwhose last parameter indicates whether the route configuration is to be inlined or not? Can the implementation of this function be replaced with a one-linerreturn defaultServerListenerCommon(host, port, secLevel, routeName, false)?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, good catch. This was left over from when I wrote the e2e test to trigger failure.