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(op-node): l1 client chan stuck when closed in ELSync mode #241

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

welkin22
Copy link
Contributor

@welkin22 welkin22 commented Sep 6, 2024

Description

Fixed the issue where the node might get stuck in the l1 client shutdown function when the node is in engine sync mode during shutdown.

Rationale

When the node has not yet fully synchronized and was in engine sync mode, the GoOrUpdatePreFetchReceipts method is not executed. At this time, the done channel of the l1 client has no consumers. If the node is closed at this moment, it will get stuck at the l1 client close operation.
If I simply close the done channel, a panic: Log in goroutine after Test_xxx has completed issue will occur during e2e testing. I must ensure that the done channel is truly closed before the close method returns.

Example

none

Changes

Notable changes:

  • Add preFetchReceiptsClosedChan to ensure that everything is closed before returning from the Close function
  • Add isPreFetchReceiptsRunning to ensure that the node does not get stuck during shutdown when in Engine Sync mode.

@github-actions github-actions bot requested review from bnoieh and redhdx September 6, 2024 09:23
@welkin22 welkin22 changed the title fix(op-node): l1 client chan stuck when close fix(op-node): l1 client chan stuck when closed in ELSync mode Sep 8, 2024
@owen-reorg owen-reorg merged commit c6a6bf5 into bnb-chain:develop Sep 10, 2024
12 checks passed
@owen-reorg owen-reorg mentioned this pull request Sep 26, 2024
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.

3 participants