[#1621] treesvc: Cancel background sync on failure
If applyOperationStream() exits prematurely, other goroutines will block on send and errgroup will never finish waiting. In this commit we also check whether context is cancelled. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
0ea602897b
commit
b8a3f3bbd9
2 changed files with 26 additions and 12 deletions
|
@ -1,6 +1,7 @@
|
|||
package tree
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/pilorama"
|
||||
|
@ -64,7 +65,7 @@ func Test_mergeOperationStreams(t *testing.T) {
|
|||
merged := make(chan *pilorama.Move, 1)
|
||||
min := make(chan uint64)
|
||||
go func() {
|
||||
min <- mergeOperationStreams(nodeOpChans, merged)
|
||||
min <- mergeOperationStreams(context.Background(), nodeOpChans, merged)
|
||||
}()
|
||||
|
||||
var res []uint64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue