mirror of https://github.com/status-im/op-geth.git
62dc59c2bd
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. |
||
---|---|---|
.. | ||
api.go | ||
downloader.go | ||
downloader_test.go | ||
events.go | ||
fakepeer.go | ||
metrics.go | ||
modes.go | ||
peer.go | ||
peer_test.go | ||
queue.go | ||
queue_test.go | ||
resultstore.go | ||
statesync.go | ||
testchain_test.go | ||
types.go |