Ting Yuan 1b700e5ed8 Fix the goroutine leak in StubServer
---

(If this PR fixes a github issue, please add `Fixes #<xyz>`)

Fixes #13023

(or if this PR is one task of a github issue, please add `Master Issue: #<xyz>`
to link to the master issue)

Master Issue: #13023

*Motivation*

Currently, StubServer can stop itself (by Stop()) before it start its
grpc server (created by Start()). This race condition may lead to a
goroutine leak mentioned by #13023.

*Modifications*

This PR add a channel to force the Stop() started after Start()

*Verify this change*

Please pick either of following options.

- This change is already covered by existing tests, such as *(please describe tests)*.

Test/TestEtcdGrpcResolver
2021-05-21 20:54:06 +08:00
..
2018-07-21 15:49:58 -07:00
2018-02-28 17:27:40 -08:00
2020-02-12 11:15:41 -08:00
2018-04-30 15:32:16 -07:00
2018-04-08 14:18:09 -07:00
2021-05-14 22:45:57 +02:00
2021-05-14 22:45:57 +02:00

pkg/ is a collection of utility packages used by etcd without being specific to etcd itself. A package belongs here only if it could possibly be moved out into its own repository in the future.