mirror of https://github.com/minio/minio.git
fix: allow global leader lock context merge to be canceled (#16603)
Global leader lock was first designated to only acquired once until the node is killed. However, currently, the code acquires it repeatedly during the lifetime of the server, now there is a goroutine leak.
This commit is contained in:
parent
1d3b18c3f4
commit
d6d01067a0
|
@ -63,6 +63,8 @@ func mergeContext(ctx1, ctx2 context.Context) (context.Context, context.CancelFu
|
||||||
select {
|
select {
|
||||||
case <-ctx1.Done():
|
case <-ctx1.Done():
|
||||||
case <-ctx2.Done():
|
case <-ctx2.Done():
|
||||||
|
// The lock acquirer decides to cancel, exit this goroutine
|
||||||
|
case <-ctx.Done():
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel()
|
cancel()
|
||||||
|
|
Loading…
Reference in New Issue