mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
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:
@@ -63,6 +63,8 @@ func mergeContext(ctx1, ctx2 context.Context) (context.Context, context.CancelFu
|
||||
select {
|
||||
case <-ctx1.Done():
|
||||
case <-ctx2.Done():
|
||||
// The lock acquirer decides to cancel, exit this goroutine
|
||||
case <-ctx.Done():
|
||||
}
|
||||
|
||||
cancel()
|
||||
|
||||
Reference in New Issue
Block a user