go-ethereum/eth/downloader
lzhfromustc 62dc59c2bd
miner, test: fix potential goroutine leak (#21989)
In miner/worker.go, there are two goroutine using channel w.newWorkCh: newWorkerLoop() sends to this channel, and mainLoop() receives from this channel. Only the receive operation is in a select.

However, w.exitCh may be closed by another goroutine. This is fine for the receive since receive is in select, but if the send operation is blocking, then it will block forever. This commit puts the send in a select, so it won't block even if w.exitCh is closed.

Similarly, there are two goroutines using channel errc: the parent that runs the test receives from it, and the child created at line 573 sends to it. If the parent goroutine exits too early by calling t.Fatalf() at line 614, then the child goroutine will be blocked at line 574 forever. This commit adds 1 buffer to errc. Now send will not block, and receive is not influenced because receive still needs to wait for the send.
2020-12-11 10:29:42 +01:00
..
api.go all: remove redundant conversions and import names (#21903) 2020-11-25 21:00:23 +01:00
downloader_test.go miner, test: fix potential goroutine leak (#21989) 2020-12-11 10:29:42 +01:00
downloader.go all: replace RWMutex with Mutex in places where RLock is not used (#21622) 2020-10-13 10:58:41 +02:00
events.go cmd,eth: 16400 Add an option to stop geth once in sync. WIP for light mode (#17321) 2019-01-30 08:40:36 +01:00
fakepeer.go core, eth, les, light: scope receipt functionality a bit cleaner 2019-04-15 13:42:26 +03:00
metrics.go eth/downloader: refactor downloader + queue (#21263) 2020-07-24 10:46:26 +03:00
modes.go eth/downloader: fixes data race between synchronize and other methods (#21201) 2020-06-30 19:43:29 +02:00
peer_test.go eth/downloader: refactor downloader + queue (#21263) 2020-07-24 10:46:26 +03:00
peer.go eth/downloader: remove eth62 (#21378) 2020-07-29 13:47:19 +03:00
queue_test.go eth/downloader: change intial download size (#21366) 2020-09-02 11:01:46 +02:00
queue.go eth/downloader: cache parent hash instead of recomputing (#21678) 2020-10-09 09:09:10 +02:00
resultstore.go eth/downloader: refactor downloader + queue (#21263) 2020-07-24 10:46:26 +03:00
statesync.go core, eth, trie: prepare trie sync for path based operation 2020-09-02 13:21:32 +03:00
testchain_test.go eth/downloader: dynamically move pivot even during chain sync 2020-09-18 11:37:42 +03:00
types.go eth: conform better to the golint standards (#16783) 2018-06-14 13:14:52 +03:00