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

Do not keep dispatching after block listener falls behind #129

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

peterbroadhurst
Copy link
Contributor

@peterbroadhurst peterbroadhurst commented Sep 3, 2024

Fixes #127

When I spent time breaking down the test to remove timing conditions, I found I was driving the logic below the new return I added in invalid ways. So the return felt much better to leave the existing queue in flight, and then the dispatcher will still fall back to getBlockByNumber

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst peterbroadhurst requested a review from a team as a code owner September 3, 2024 15:45
@@ -194,12 +194,12 @@ func (cbl *confirmedBlockListener) processBlockNotification(block *apitypes.Bloc
var dispatchHead *apitypes.BlockInfo
if len(cbl.newHeadToAdd) > 0 {
// we've snuck in multiple notifications while the dispatcher is busy... don't add indefinitely to this list
if len(cbl.newHeadToAdd) > 10 /* not considered worth adding/explaining a tuning property for this */ {
if len(cbl.newHeadToAdd) >= 10 /* not considered worth adding/explaining a tuning property for this */ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - just not sure why the change from > to >=?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 just felt weird

@matthew1001 matthew1001 merged commit 97dc2d9 into main Sep 3, 2024
2 checks passed
@peterbroadhurst peterbroadhurst deleted the fix-127 branch September 3, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermittently failed test
2 participants