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

[Access] Heartbeat interval not reset correctly in streaming endpoints. #6848

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (p *AccountStatusesDataProvider) handleResponse() func(accountStatusesRespo
if blocksSinceLastMessage < p.heartbeatInterval {
return nil
}
blocksSinceLastMessage = 0
}
blocksSinceLastMessage = 0

index := messageIndex.Value()
if ok := messageIndex.Set(messageIndex.Value() + 1); !ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ func (p *EventsDataProvider) handleResponse() func(eventsResponse *backend.Event
if blocksSinceLastMessage < p.heartbeatInterval {
return nil
}
blocksSinceLastMessage = 0
}
blocksSinceLastMessage = 0

index := messageIndex.Value()
if ok := messageIndex.Set(messageIndex.Value() + 1); !ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func (wsController *WebsocketController) writeEvents(sub subscription.Subscripti
if blocksSinceLastMessage < wsController.HeartbeatInterval {
continue
}
blocksSinceLastMessage = 0
}
blocksSinceLastMessage = 0

// EventsResponse contains CCF encoded events, and this API returns JSON-CDC events.
// convert event payload formats.
Expand Down
4 changes: 2 additions & 2 deletions engine/access/state_stream/backend/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ func (h *Handler) handleEventsResponse(send sendSubscribeEventsResponseFunc, hea
if blocksSinceLastMessage < heartbeatInterval {
return nil
}
blocksSinceLastMessage = 0
}
blocksSinceLastMessage = 0

// BlockExecutionData contains CCF encoded events, and the Access API returns JSON-CDC events.
// convert event payload formats.
Expand Down Expand Up @@ -490,8 +490,8 @@ func (h *Handler) handleAccountStatusesResponse(
if blocksSinceLastMessage < heartbeatInterval {
return nil
}
blocksSinceLastMessage = 0
}
blocksSinceLastMessage = 0

results, err := convertAccountsStatusesResultsToMessage(evenVersion, resp)
if err != nil {
Expand Down
Loading