Skip to content

Commit

Permalink
当etcd开启https时,过多的请求将会阻塞,修复MaxConcurrentStreams过小
Browse files Browse the repository at this point in the history
  • Loading branch information
杨金珏 committed Apr 25, 2022
1 parent b00bb53 commit 4ad859d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/embed/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package embed
import (
"context"
"fmt"
"golang.org/x/net/http2"
"io"
defaultLog "log"
"math"
Expand Down Expand Up @@ -191,6 +192,11 @@ func (sctx *serveCtx) serve(
TLSConfig: tlscfg,
ErrorLog: logger, // do not log user error
}
if err := http2.ConfigureServer(srv, &http2.Server{
MaxConcurrentStreams: math.MaxUint32,
}); err != nil {
return err
}
go func() { errHandler(srv.Serve(tlsl)) }()

sctx.serversC <- &servers{secure: true, grpc: gs, http: srv}
Expand Down

0 comments on commit 4ad859d

Please sign in to comment.