Skip to content

fix(core): report unexpected Process call instead of failing from indexer goroutine #22346 - #2583

Open
gzliudan wants to merge 1 commit into
XinFinOrg:dev-upgradefrom
gzliudan:fix-chain-indexer-process-goroutine
Open

gzliudan wants to merge 1 commit into
XinFinOrg:dev-upgradefrom
gzliudan:fix-chain-indexer-process-goroutine

Conversation

@gzliudan

Copy link
Copy Markdown
Collaborator

Port upstream go-ethereum ethereum#22346 (c454717fa6): the 10 second timeout of testChainIndexBackend.Process called t.Fatal from the chain indexer's own updateLoop goroutine.

FailNow ends the goroutine that calls it, so the indexer's update loop died for good, and Close() could then block forever on its quit channel, turning a test that was about to finish into a hang. Report the unexpected call with t.Error and return an error instead, which is what upstream does: the error makes processSection fail and the update loop stop by itself, without killing its goroutine.

Test infrastructure only, no production code touched. This does not fix the Canonical section count mismatch flake, which is fixed by #2582; best merged after that one, because until then a make quick-test run of this branch can still hit that flake.

Verification: make all, make quick-test and one full make test at this commit.

…exer goroutine ethereum#22346

The 10 second timeout of testChainIndexBackend.Process called t.Fatal from the
chain indexer's own updateLoop goroutine. FailNow ends that goroutine, which
stops the indexer for good and can leave Close() blocked on its quit channel,
turning a test that was about to finish into a hang.

Report the unexpected call with t.Error and return an error instead, so the
updateLoop stays alive and stops by itself.

ported from geth c454717
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: cbbb5898-f33a-4daf-a539-845bb3b945d3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused test-only change matches upstream and preserves indexer cleanup behavior.

Pull request overview

Ports upstream go-ethereum ethereum#22346 to prevent a test indexer goroutine from terminating unexpectedly and hanging cleanup.

Changes:

  • Replaces t.Fatal with t.Error.
  • Returns an error to stop the current indexing attempt safely.
File summaries
File Description
core/chain_indexer_test.go Safely reports unexpected test backend processing calls.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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