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

Fix watch stream starvation #15403

Closed
wants to merge 6 commits into from
Closed

Conversation

serathius
Copy link
Member

@serathius serathius commented Mar 3, 2023

Ref #15402

Cleaning up serving code and moving grpc server from under http server. Now multiplexing between grpc API and http API will be the same for both TLS and non-TLS config. It will be done by checking HTTP1 (http) vs HTTP2 (grpc).

cc @ahrtr @ptabor

@serathius serathius force-pushed the fix-watch-starving branch 5 times, most recently from f705b1b to 51bf64c Compare March 3, 2023 15:02
@serathius
Copy link
Member Author

This change breaks curl test :(

curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream

Marking as draft for debug

@serathius serathius marked this pull request as draft March 3, 2023 15:40
@@ -51,6 +51,7 @@ func (e e2eRunner) NewCluster(ctx context.Context, t testing.TB, opts ...config.
WithStrictReconfigCheck(cfg.StrictReconfigCheck),
WithAuthTokenOpts(cfg.AuthToken),
WithSnapshotCount(cfg.SnapshotCount),
WithWatchProcessNotifyInterval(cfg.WatchProgressNotifyInterval),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we bundle this with this PR ?

I assume the change should be neutral for the core-logic change... and is here due to needs of the grpc_test ?

Copy link
Member Author

@serathius serathius Mar 7, 2023

Choose a reason for hiding this comment

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

Yes, this change comes with 3 dedicated tests for all types of watch response. I needed to change some code to expose periodic progress notification.

}
m := cmux.New(listener)
go func() { errHandler(srv.Serve(m.Match(cmux.HTTP1()))) }()
go func() { errHandler(gs.Serve(m.Match(cmux.HTTP2()))) }()
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a TODO to consider switching to:
cmux.HTTP2HeaderField("content-type", "application/grpc")
to avoid issues if any client/prometheous switches to http2.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think what you suggest will be better, however we need to validate if it breaks non-TLS in any way.

tests/common/grpc_test.go Show resolved Hide resolved
tests/common/grpc_test.go Show resolved Hide resolved
tests/common/grpc_test.go Outdated Show resolved Hide resolved
sctx.lg.Error("Configure https server failed", zap.Error(err))
listener := sctx.l
if sctx.secure {
listener, err = transport.NewTLSListener(listener, tlsinfo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we covering here /healthz and /metrics endpoints with mTLS that used to be unprotected previously ?

#11993
#12370 (comment)

@serathius serathius force-pushed the fix-watch-starving branch from 51bf64c to 85b2fc9 Compare March 7, 2023 11:19
@serathius
Copy link
Member Author

Closing for #15431

@serathius serathius closed this Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants