bsc/eth
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
..
downloader miner, test: fix potential goroutine leak (#21989) 2020-12-11 10:29:42 +01:00
fetcher core, eth, les, trie: add a prefix to contract code (#21080) 2020-08-21 15:10:40 +03:00
filters all: remove redundant conversions and import names (#21903) 2020-11-25 21:00:23 +01:00
gasprice cmd, eth: offer maxprice flag for overwritting price cap (#21531) 2020-09-09 18:38:47 +03:00
tracers all: remove redundant conversions and import names (#21903) 2020-11-25 21:00:23 +01:00
api_backend.go core, all: split vm.Context into BlockContext and TxContext (#21672) 2020-11-13 13:42:19 +01:00
api_test.go all: disable recording preimage of trie keys (#21402) 2020-11-18 11:51:33 +02:00
api_tracer.go eth: fix error in tracing if reexec is set (#21830) 2020-12-02 12:49:20 +01:00
api.go eth/api: fix potential nil deref in AccountRange (#21710) 2020-10-20 20:19:21 +02:00
backend.go les: fix nodiscover option (#21906) 2020-12-01 10:03:41 +01:00
bloombits.go eth: updated comments (#21490) 2020-08-26 13:20:12 +03:00
config.go all: disable recording preimage of trie keys (#21402) 2020-11-18 11:51:33 +02:00
discovery.go les: fix nodiscover option (#21906) 2020-12-01 10:03:41 +01:00
gen_config.go all: disable recording preimage of trie keys (#21402) 2020-11-18 11:51:33 +02:00
handler_test.go eth: increase timeout in TestBroadcastBlock (#21299) 2020-07-08 11:50:26 +02:00
handler.go trie: use stacktrie for Derivesha operation (#21407) 2020-09-29 17:38:13 +02:00
helper_test.go cmd/devp2p: add eth protocol test suite (#21598) 2020-09-23 15:18:17 +02:00
peer.go eth: use maxQueuedTxAnns for to limit the number of transactions announced (#21419) 2020-08-06 15:19:00 +03:00
protocol_test.go cmd/devp2p: add eth protocol test suite (#21598) 2020-09-23 15:18:17 +02:00
protocol.go eth: rework tx fetcher to use O(1) ops + manage network requests 2020-02-13 15:27:15 +02:00
sync_test.go eth: improve shutdown synchronization (#20695) 2020-03-27 15:03:20 +02:00
sync.go core: define and test chain rewind corner cases (#21409) 2020-08-20 13:01:24 +03:00