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

core, light: check chain status before importing #19987

Open
wants to merge 1 commit into
base: master
from

Conversation

@rjl493456442
Copy link
Member

commented Aug 21, 2019

This PR fixes #19965

The root issue is in the Stop function of core.Blockchain, it will try to set closed as true and wait all in-flight importers to finish their jobs. However, the WriteBlockWithState is not tracked by waitGroup.

This PR adds check for some mutation function of core.Blockchain as well as light.LightChain. When it tries to import something, it has to check whether is chain is already closed.

@rjl493456442

This comment has been minimized.

Copy link
Member Author

commented Aug 28, 2019

Please also check this panic

Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  panic: sync: WaitGroup is reused before previous Wait has returned
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  goroutine 877231 [running]:
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  sync.(*WaitGroup).Wait(0xc0235de378)
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  	/usr/local/go/src/sync/waitgroup.go:132 +0xae
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  github.com/ethereum/go-ethereum/core.(*BlockChain).Stop(0xc0235de000)
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  	/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/core/blockchain.go:807 +0x9f
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  github.com/ethereum/go-ethereum/eth.(*Ethereum).Stop(0xc000476b60, 0xc00018e000, 0xc0607cdf58)
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  	/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/eth/backend.go:553 +0x45
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  github.com/ethereum/go-ethereum/node.(*Node).Stop(0xc0002a3680, 0x0, 0x0)
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  	/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/node/node.go:447 +0x1cd
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  created by github.com/ethereum/go-ethereum/cmd/utils.StartNode.func1
Aug 27 18:54:45 bootnode-azure-australiaeast-001 geth:  	/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/cmd/utils/cmd.go:76 +0x165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.