Skip to content

Commit

Permalink
fix(storev2/snapshots): Close StateChanges channel in `doRestoreSna…
Browse files Browse the repository at this point in the history
…pshot` (#21106)
  • Loading branch information
hieuvubk committed Aug 2, 2024
1 parent e507900 commit bc72e34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store/v2/snapshots/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io.

// chStorage is the channel to pass the KV pairs to the storage snapshotter.
chStorage := make(chan *corestore.StateChanges, defaultStorageChannelBufferSize)
defer close(chStorage)

storageErrs := make(chan error, 1)
go func() {
Expand All @@ -415,6 +414,7 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io.
if err != nil {
return errorsmod.Wrap(err, "multistore restore")
}
close(chStorage)

for {
if nextItem.Item == nil {
Expand Down

0 comments on commit bc72e34

Please sign in to comment.