Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: do not reset snapshot and once in tryFetch #1827

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/depth/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func (b *Buffer) fetchAndPush() error {
if len(b.buffer) > 0 {
// the snapshot is too early
if finalUpdateID < b.buffer[0].FirstUpdateID-1 {
b.resetSnapshot()
b.emitReset()
// reset buffer
b.buffer = nil
b.mu.Unlock()
return fmt.Errorf("depth snapshot is too early, final update %d is < the first update id %d", finalUpdateID, b.buffer[0].FirstUpdateID)
}
Expand All @@ -163,8 +163,8 @@ func (b *Buffer) fetchAndPush() error {
}

if u.FirstUpdateID > finalUpdateID+1 {
b.resetSnapshot()
b.emitReset()
// reset buffer
b.buffer = nil
b.mu.Unlock()
return fmt.Errorf("there is a missing depth update, the update id %d > final update id %d + 1", u.FirstUpdateID, finalUpdateID)
}
Expand Down
Loading