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

[R4R]fix deadlock on miner module when failed to commit trie #835

Merged
merged 1 commit into from
Apr 2, 2022

Conversation

unclezoro
Copy link
Collaborator

Description

A possible deadlock when commit trie failed

Rationale

A node stuck and failed to import any blocks, the go routine profile is: routine.txt

github.com/ethereum/go-ethereum/core/state.(*StateDB).Commit.func1.1(0x40eefc8fc0, 0x0, 0x420496c2f8, 0x1, 0x1, 0x572e056600a67eff, 0x99b123d0825edb78)
	/ext-go/1/src/github.com/ethereum/go-ethereum/core/state/statedb.go:1367 +0x2d4
github.com/ethereum/go-ethereum/core/state.(*StateDB).Commit.func1(0x0, 0x0)
	/ext-go/1/src/github.com/ethereum/go-ethereum/core/state/statedb.go:1413 +0x5c
github.com/ethereum/go-ethereum/core/state.(*StateDB).Commit.func4(0x429104c180, 0x4316b0ec80)
	/ext-go/1/src/github.com/ethereum/go-ethereum/core/state/statedb.go:1502 +0x28
created by github.com/ethereum/go-ethereum/core/state.(*StateDB).Commit
	/ext-go/1/src/github.com/ethereum/go-ethereum/core/state/statedb.go:1501 +0x200

image

Blocked in sending task to tasks channel.

The task itself will send response to taskResults, if CommitTrie failed, taskResults will get two signal, while the size of taskResults is len(s.stateObjectsDirty), which will cause the routine blocked.

Example

No

Changes

No

NashBC
NashBC approved these changes Apr 2, 2022
@unclezoro unclezoro merged commit 05925da into bnb-chain:develop Apr 2, 2022
@Delegat43
Copy link

05925da

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.

7 participants