replication: Init worker kill channel correctly (#12379)

Signed-off-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
Poorna Krishnamoorthy 2021-05-28 13:28:37 -07:00 committed by GitHub
parent 4444ba13a4
commit 547bb7d0a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
}
}