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() {
|
||||
if s.store != nil {
|
||||
s.Require().Nil(s.store.Close())
|
||||
s.Require().NoError(s.store.Close())
|
||||
}
|
||||
s.Require().NoError(failpoint.Disable("tikvclient/mockFastSafeTSUpdater"))
|
||||
}
|
||||
|
|
|
|||
18
tikv/kv.go
18
tikv/kv.go
|
|
@ -198,11 +198,19 @@ func WithPDHTTPClient(
|
|||
opts ...pdhttp.ClientOption,
|
||||
) Option {
|
||||
return func(o *KVStore) {
|
||||
o.pdHttpClient = pdhttp.NewClient(
|
||||
source,
|
||||
pdAddrs,
|
||||
opts...,
|
||||
)
|
||||
if cli := o.GetPDClient(); cli != nil {
|
||||
o.pdHttpClient = pdhttp.NewClientWithServiceDiscovery(
|
||||
source,
|
||||
o.pdClient.GetServiceDiscovery(),
|
||||
opts...,
|
||||
)
|
||||
} else {
|
||||
o.pdHttpClient = pdhttp.NewClient(
|
||||
source,
|
||||
pdAddrs,
|
||||
opts...,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue