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

ethclient: ensure the close of canceled context #28349

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

keroro520
Copy link
Contributor

@keroro520 keroro520 commented Oct 16, 2023

Case TestEthClient/TxInBlockInterrupted checks whether the interface eth_getTransactionByBlockHashAndIndex works correctly with a canceled context. Therefore, it passes a cancelled context to the interface and expects a nil transaction is returned.

However, as the close of the Done channel may happen asynchronously after the cancel function returns, this test case may occasionally return a non-nil transaction.

This PR adds <-ctx.Done() to ensure the close of the Done channel.


The test case has failed several times on free GitHub Actions CI runners.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@holiman holiman modified the milestones: 1.13.4, 1.13.5 Oct 17, 2023
@holiman holiman merged commit 1f11d2d into ethereum:master Oct 17, 2023
2 checks passed
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Dergarcon pushed a commit to specialmechanisms/mev-geth-0x2mev that referenced this pull request Jan 31, 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