Fix streaming manager deadlock on collection

Ensure that lock is released and stream is closed.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-03-01 09:26:44 -08:00
parent 2be87c1a75
commit 5c6e9f83d4
2 changed files with 16 additions and 5 deletions

View File

@@ -359,6 +359,7 @@ func (m *DB) GarbageCollect(ctx context.Context) (gc.Stats, error) {
marked, err := m.getMarked(ctx, c) // Pass in gc context
if err != nil {
m.wlock.Unlock()
c.cancel(ctx)
return nil, err
}