Skip to content

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

Merged
unclezoro merged 1 commit intobnb-chain:developfrom
unclezoro:deadlocOnCommitTrie
Apr 2, 2022
Merged

[R4R]fix deadlock on miner module when failed to commit trie#835
unclezoro merged 1 commit intobnb-chain:developfrom
unclezoro:deadlocOnCommitTrie

Conversation

@unclezoro
Copy link
Copy Markdown
Contributor

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

@unclezoro unclezoro force-pushed the deadlocOnCommitTrie branch from 0358d90 to 9691a8e Compare April 2, 2022 06:48
NashBC
NashBC approved these changes Apr 2, 2022
@unclezoro unclezoro merged commit 05925da into bnb-chain:develop Apr 2, 2022
@Delegat43
Copy link
Copy Markdown

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