소스 검색

rpc: cancel root context after all requests are served (#19430)

gary rong 6 년 전
부모
커밋
e4cb7b80d5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      rpc/handler.go

+ 1 - 1
rpc/handler.go

@@ -151,8 +151,8 @@ func (h *handler) handleMsg(msg *jsonrpcMessage) {
 // call goroutines to shut down.
 func (h *handler) close(err error, inflightReq *requestOp) {
 	h.cancelAllRequests(err, inflightReq)
-	h.cancelRoot()
 	h.callWG.Wait()
+	h.cancelRoot()
 	h.cancelServerSubscriptions(err)
 }