mirror of https://github.com/tikv/client-go.git
fix goroutine leak
Signed-off-by: lance6716 <lance6716@gmail.com>
This commit is contained in:
parent
29355d50d1
commit
cfee5d73dd
|
|
@ -205,7 +205,7 @@ func (s *apiTestSuite) TestInitClusterMinResolvedTSZero() {
|
||||||
|
|
||||||
func (s *apiTestSuite) TearDownTest() {
|
func (s *apiTestSuite) TearDownTest() {
|
||||||
if s.store != nil {
|
if s.store != nil {
|
||||||
s.Require().Nil(s.store.Close())
|
s.Require().NoError(s.store.Close())
|
||||||
}
|
}
|
||||||
s.Require().NoError(failpoint.Disable("tikvclient/mockFastSafeTSUpdater"))
|
s.Require().NoError(failpoint.Disable("tikvclient/mockFastSafeTSUpdater"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,12 +198,20 @@ func WithPDHTTPClient(
|
||||||
opts ...pdhttp.ClientOption,
|
opts ...pdhttp.ClientOption,
|
||||||
) Option {
|
) Option {
|
||||||
return func(o *KVStore) {
|
return func(o *KVStore) {
|
||||||
|
if cli := o.GetPDClient(); cli != nil {
|
||||||
|
o.pdHttpClient = pdhttp.NewClientWithServiceDiscovery(
|
||||||
|
source,
|
||||||
|
o.pdClient.GetServiceDiscovery(),
|
||||||
|
opts...,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
o.pdHttpClient = pdhttp.NewClient(
|
o.pdHttpClient = pdhttp.NewClient(
|
||||||
source,
|
source,
|
||||||
pdAddrs,
|
pdAddrs,
|
||||||
opts...,
|
opts...,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// loadOption load KVStore option into KVStore.
|
// loadOption load KVStore option into KVStore.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue