Skip to content

Conversation

msmania
Copy link
Contributor

@msmania msmania commented Sep 25, 2023

Why this should be merged

A block-pruned node encounters deadlock if a node receives eth_getLogs for a pruned block. The node will eventually be killed because deadlocked goroutines do not release system resources.

With this patch, such eth_getLogs immediately returns a jsonrpc error.

How this works

This patch has been merged in the upstream and will be included in the next version v1.13.2. More technical details are described in the original PR ethereum/go-ethereum#28184.

Corresponding PR in Subnet EVM: ava-labs/subnet-evm#899

How this was tested

We had this deadlock in our DFK Chain node. This patch fixed it.

When MatcherSession encounters an error, it attempts to close the session.
Closing waits for all goroutines to finish, including the 'distributor'.
However, the distributor will not exit until all requests have returned.

This patch fixes the issue by delivering the (empty) result to the distributor
before calling Close().
Copy link

@darioush darioush left a comment

Choose a reason for hiding this comment

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

Thanks again!

Copy link
Collaborator

@aaronbuchwald aaronbuchwald left a comment

Choose a reason for hiding this comment

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

LGTM - thanks again!

@aaronbuchwald aaronbuchwald merged commit 95d320f into ava-labs:master Sep 26, 2023
@msmania msmania deleted the bugfix-deadlock-eth_getLogs branch September 27, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants