diff --git a/store/v2/snapshots/manager.go b/store/v2/snapshots/manager.go index 9380b3021b..7e12e4503d 100644 --- a/store/v2/snapshots/manager.go +++ b/store/v2/snapshots/manager.go @@ -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() { @@ -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 {