From c715f3b49d30cfa7a7ed9aebb374d0d901f066de Mon Sep 17 00:00:00 2001 From: Amit Dalal Date: Fri, 28 May 2021 16:04:51 +0530 Subject: [PATCH] fix race condition in shutdown --- runtime/gateway.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/gateway.go b/runtime/gateway.go index d8a93bdda..fc0124007 100644 --- a/runtime/gateway.go +++ b/runtime/gateway.go @@ -434,6 +434,9 @@ func (gateway *Gateway) Shutdown() { } }() + // wait for servers to shutdown before stopping GRPCClientDispatcher + swg.Wait() + // stop all grpc clients if gateway.GRPCClientDispatcher != nil { swg.Add(1)