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

Re-poll immediately on full batch #1204

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

peterbroadhurst
Copy link
Contributor

@peterbroadhurst peterbroadhurst commented Mar 7, 2023

After a rewind to recover from an missed batch (an occurrence of hyperledger/firefly-evmconnect#53) I observed a slow recovery, and the logs seemed to show the Event Aggregator pausing for long periods rather than screaming through all the messages.

Investigating the code, I did not find anything that would prevent it waiting the full time in the case of having read a full page of events. This would mean when paging through old events a long way before the head, it could be very slow to recover.

Note, you only notice this when in recovery mode after a rewind when events are not arriving frequently - as in that case there are no shoulder taps to naturally wake the event loop.

Also, you only notice this when there is more than a full page (200) inflight pins to resolve, such that the aggregator has to keep spinning through those pages.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@codecov-commenter
Copy link

Codecov Report

Merging #1204 (08c1a13) into main (3b72853) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1204   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          305       305           
  Lines        20057     20104   +47     
=========================================
+ Hits         20057     20104   +47     
Impacted Files Coverage Δ
internal/events/event_poller.go 100.00% <100.00%> (ø)
pkg/core/message.go 100.00% <0.00%> (ø)
internal/events/aggregator.go 100.00% <0.00%> (ø)
internal/events/persist_batch.go 100.00% <0.00%> (ø)
internal/assets/token_approval.go 100.00% <0.00%> (ø)
internal/assets/token_transfer.go 100.00% <0.00%> (ø)
internal/batch/batch_processor.go 100.00% <0.00%> (ø)
internal/database/sqlcommon/sqlcommon.go 100.00% <0.00%> (ø)
internal/database/sqlcommon/message_sql.go 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants