mirror of
https://github.com/minio/minio.git
synced 2025-04-20 02:27:50 -04:00
fix: context leak with replication endpoint hearbeat (#15721)
This commit is contained in:
parent
b2a67834ac
commit
749ce107ee
@ -108,7 +108,6 @@ func (sys *BucketTargetSys) heartBeat(ctx context.Context) {
|
|||||||
|
|
||||||
if len(eps) > 0 {
|
if len(eps) > 0 {
|
||||||
cctx, cancel := context.WithTimeout(ctx, 30*time.Second)
|
cctx, cancel := context.WithTimeout(ctx, 30*time.Second)
|
||||||
defer cancel()
|
|
||||||
m := map[string]epHealth{}
|
m := map[string]epHealth{}
|
||||||
for result := range sys.hcClient.Alive(cctx, madmin.AliveOpts{}, eps...) {
|
for result := range sys.hcClient.Alive(cctx, madmin.AliveOpts{}, eps...) {
|
||||||
var online bool
|
var online bool
|
||||||
@ -121,6 +120,7 @@ func (sys *BucketTargetSys) heartBeat(ctx context.Context) {
|
|||||||
Online: online,
|
Online: online,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cancel()
|
||||||
sys.hMutex.Lock()
|
sys.hMutex.Lock()
|
||||||
sys.hc = m
|
sys.hc = m
|
||||||
sys.hMutex.Unlock()
|
sys.hMutex.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user