Skip to content

Commit

Permalink
fix leaking snapshot stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Termina1 committed Dec 24, 2024
1 parent 9468ee8 commit ba34452
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ func (sync *Syncer) Feed(ctx context.Context) (recs protocol.Records, err error)
} else {
sync.SetFeedState(ctx, SendEOF)
}
_ = sync.snap.Close()

err = sync.snap.Close()
if err != nil {
sync.log.ErrorCtx(sync.logCtx(ctx), "sync: failed closing snapshot", "err", err)
} else {
OpenedSnapshots.WithLabelValues(sync.Name).Set(0)
}
sync.snap = nil
err = nil
}
Expand Down

0 comments on commit ba34452

Please sign in to comment.