From 547bb7d0a1ea613a01ef6358ba79f6f13e83f17c Mon Sep 17 00:00:00 2001 From: Poorna Krishnamoorthy Date: Fri, 28 May 2021 13:28:37 -0700 Subject: [PATCH] replication: Init worker kill channel correctly (#12379) Signed-off-by: Poorna Krishnamoorthy --- cmd/bucket-replication.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 37010eae1..b0f308a2c 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -868,9 +868,12 @@ func NewReplicationPool(ctx context.Context, o ObjectLayer, opts replicationPool replicaCh: make(chan ReplicateObjectInfo, 100000), replicaDeleteCh: make(chan DeletedObjectVersionInfo, 100000), mrfReplicaCh: make(chan ReplicateObjectInfo, 100000), + workerKillCh: make(chan struct{}, opts.Workers), + mrfWorkerKillCh: make(chan struct{}, opts.FailedWorkers), ctx: ctx, objLayer: o, } + pool.ResizeWorkers(opts.Workers) pool.ResizeFailedWorkers(opts.FailedWorkers) return pool @@ -888,6 +891,8 @@ func (p *ReplicationPool) AddMRFWorker() { return } replicateObject(p.ctx, oi, p.objLayer) + case <-p.mrfWorkerKillCh: + return } } }