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

etcdserver: create separate goroutine to accept grpc tls connection #15451

Closed
wants to merge 1 commit into from

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Mar 13, 2023

Try to resolve #15402

This solution has a major issue... the HTTP requests (e.g /health, /metrics, etc.) can't go through HTTP/2. Probably this issue should be resolved in github.com/soheilhy/cmux?

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@ahrtr ahrtr marked this pull request as draft March 13, 2023 06:05
Signed-off-by: Benjamin Wang <wachao@vmware.com>
@@ -176,7 +176,8 @@ func (sctx *serveCtx) serve(
if sctx.serviceRegister != nil {
sctx.serviceRegister(gs)
}
handler = grpcHandlerFunc(gs, handler)
grpcl := m.Match(cmux.HTTP2())
Copy link
Member

@serathius serathius Mar 13, 2023

Choose a reason for hiding this comment

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

As mentioned in original issue, using HTTP2 to separate grpc vs http2 traffic breaks backward compatibility

@serathius
Copy link
Member

serathius commented Mar 14, 2023

To avoid wasting work to rediscover same problem I recommend you take a look into main...serathius:etcd:fix-watch-starving This is a full implementation of what this PR tries.

Unfortunately during testing I found that we cannot fix the issue without making a backward incompatible change.

To make it explicit I have send separate PR that adds regression testing for cmux #15479

Results for my implementation:

--- FAIL: TestConnectionMultiplexingTLS (11.05s)
    --- FAIL: TestConnectionMultiplexingTLS/etcdctl (5.01s)
    --- FAIL: TestConnectionMultiplexingTLS/clientv3 (5.00s)
    --- FAIL: TestConnectionMultiplexingTLS/curl (0.24s)
        --- FAIL: TestConnectionMultiplexingTLS/curl/http2 (0.02s)
        --- PASS: TestConnectionMultiplexingTLS/curl/http1.1 (0.10s)
        --- PASS: TestConnectionMultiplexingTLS/curl/http1.0 (0.10s)
        --- FAIL: TestConnectionMultiplexingTLS/curl/default (0.02s)
--- PASS: TestConnectionMultiplexingNonTLS (0.42s)
    --- PASS: TestConnectionMultiplexingNonTLS/etcdctl (0.02s)
    --- PASS: TestConnectionMultiplexingNonTLS/clientv3 (0.00s)
    --- PASS: TestConnectionMultiplexingNonTLS/curl (0.23s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/http2 (0.06s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/http1.1 (0.05s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/http1.0 (0.06s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/default (0.06s)
--- FAIL: TestConnectionMultiplexingTlsAndNonTLS (10.68s)
    --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS (10.27s)
        --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/etcdctl (5.02s)
        --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/clientv3 (5.00s)
        --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl (0.25s)
            --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/http2 (0.02s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/http1.1 (0.11s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/http1.0 (0.10s)
            --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/default (0.02s)
    --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS (0.25s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/etcdctl (0.02s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/clientv3 (0.00s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl (0.22s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/http2 (0.06s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/http1.1 (0.06s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/http1.0 (0.06s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/default (0.05s)

Results for your implementation:

--- FAIL: TestConnectionMultiplexingTLS (0.81s)
    --- FAIL: TestConnectionMultiplexingTLS/etcdctl (0.02s)
    --- FAIL: TestConnectionMultiplexingTLS/clientv3 (0.01s)
    --- PASS: TestConnectionMultiplexingTLS/curl (0.40s)
        --- PASS: TestConnectionMultiplexingTLS/curl/http2 (0.10s)
        --- PASS: TestConnectionMultiplexingTLS/curl/http1.1 (0.11s)
        --- PASS: TestConnectionMultiplexingTLS/curl/http1.0 (0.09s)
        --- PASS: TestConnectionMultiplexingTLS/curl/default (0.10s)
--- PASS: TestConnectionMultiplexingNonTLS (0.82s)
    --- PASS: TestConnectionMultiplexingNonTLS/etcdctl (0.02s)
    --- PASS: TestConnectionMultiplexingNonTLS/clientv3 (0.00s)
    --- PASS: TestConnectionMultiplexingNonTLS/curl (0.21s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/http2 (0.06s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/http1.1 (0.05s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/http1.0 (0.05s)
        --- PASS: TestConnectionMultiplexingNonTLS/curl/default (0.06s)
--- FAIL: TestConnectionMultiplexingTlsAndNonTLS (1.55s)
    --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS (0.45s)
        --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/etcdctl (0.02s)
        --- FAIL: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/clientv3 (0.01s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl (0.42s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/http2 (0.11s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/http1.1 (0.10s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/http1.0 (0.10s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientTLS/curl/default (0.10s)
    --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS (0.22s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/etcdctl (0.02s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/clientv3 (0.00s)
        --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl (0.20s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/http2 (0.06s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/http1.1 (0.05s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/http1.0 (0.04s)
            --- PASS: TestConnectionMultiplexingTlsAndNonTLS/ClientNoTLS/curl/default (0.04s)

@ahrtr ahrtr mentioned this pull request Mar 18, 2023
@ahrtr ahrtr closed this Apr 7, 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.

Etcd watch stream starvation under high read response load when sharing same connection and TLS is enabled
2 participants