• Felix Lange's avatar
    core, eth, miner: improve shutdown synchronisation · 56ed6152
    Felix Lange authored
    Shutting down geth prints hundreds of annoying error messages in some
    cases. The errors appear because the Stop method of eth.ProtocolManager,
    miner.Miner and core.TxPool is asynchronous. Left over peer sessions
    generate events which are processed after Stop even though the database
    has already been closed.
    
    The fix is to make Stop synchronous using sync.WaitGroup.
    
    For eth.ProtocolManager, in order to make use of WaitGroup safe, we need
    a way to stop new peer sessions from being added while waiting on the
    WaitGroup. The eth protocol Run function now selects on a signaling
    channel and adds to the WaitGroup only if ProtocolManager is not
    shutting down.
    
    For miner.worker and core.TxPool the number of goroutines is static,
    WaitGroup can be used in the usual way without additional
    synchronisation.
    56ed6152
Name
Last commit
Last update
.github Loading commit data...
Godeps Loading commit data...
_data Loading commit data...
accounts Loading commit data...
build Loading commit data...
cmd Loading commit data...
common Loading commit data...
compression/rle Loading commit data...
containers Loading commit data...
core Loading commit data...
crypto Loading commit data...
errs Loading commit data...
eth Loading commit data...
ethdb Loading commit data...
event Loading commit data...
generators Loading commit data...
internal Loading commit data...
jsre Loading commit data...
light Loading commit data...
logger Loading commit data...
metrics Loading commit data...
miner Loading commit data...
node Loading commit data...
p2p Loading commit data...
params Loading commit data...
pow Loading commit data...
release Loading commit data...
rlp Loading commit data...
rpc Loading commit data...
tests Loading commit data...
trie Loading commit data...
whisper Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...