[#1700] gc: Wait for handlers on GC stopping
First wait for goroutine handles epoch events to not to get data race on `gc.newEpochHandlers.cancelFunc`. Then cancel handlers and wait for them. Change-Id: I71f11f8526961f8356f582a95b10eb8340c0aedd Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
bd1c18e117
commit
e142d25fac
1 changed files with 3 additions and 0 deletions
|
@ -227,6 +227,9 @@ func (gc *gc) stop(ctx context.Context) {
|
||||||
|
|
||||||
gc.log.Info(ctx, logs.ShardWaitingForGCWorkersToStop)
|
gc.log.Info(ctx, logs.ShardWaitingForGCWorkersToStop)
|
||||||
gc.wg.Wait()
|
gc.wg.Wait()
|
||||||
|
|
||||||
|
gc.newEpochHandlers.cancelFunc()
|
||||||
|
gc.newEpochHandlers.prevGroup.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterates over metabase and deletes objects
|
// iterates over metabase and deletes objects
|
||||||
|
|
Loading…
Add table
Reference in a new issue