mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #12782 from ptabor/20210316-fixes
Integration: Test flakiness fixes
This commit is contained in:
@@ -386,18 +386,14 @@ func (e *Etcd) Close() {
|
||||
}
|
||||
|
||||
func stopServers(ctx context.Context, ss *servers) {
|
||||
shutdownNow := func() {
|
||||
// first, close the http.Server
|
||||
ss.http.Shutdown(ctx)
|
||||
// then close grpc.Server; cancels all active RPCs
|
||||
ss.grpc.Stop()
|
||||
}
|
||||
// first, close the http.Server
|
||||
ss.http.Shutdown(ctx)
|
||||
|
||||
// do not grpc.Server.GracefulStop with TLS enabled etcd server
|
||||
// See https://github.com/grpc/grpc-go/issues/1384#issuecomment-317124531
|
||||
// and https://github.com/etcd-io/etcd/issues/8916
|
||||
if ss.secure {
|
||||
shutdownNow()
|
||||
ss.grpc.Stop()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -415,7 +411,7 @@ func stopServers(ctx context.Context, ss *servers) {
|
||||
case <-ctx.Done():
|
||||
// took too long, manually close open transports
|
||||
// e.g. watch streams
|
||||
shutdownNow()
|
||||
ss.grpc.Stop()
|
||||
|
||||
// concurrent GracefulStop should be interrupted
|
||||
<-ch
|
||||
|
||||
Reference in New Issue
Block a user