mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
There is data race on `stop` channel. After verify write-timeout successfully, the case won't wait for `blocker` to receive close signal from `stop` channel. If the new `blocker`, which is to read-timeout verifier, get dial's result immediately, the new `blocker` might fetch the message from `stop` channel before old one and then close the connection, which causes that the `conn.Read` returns `EOF` when it reads data. How to reproduce this in linux devbox? Use `taskset` to limit the test process in one-cpu. ```bash cd ./client/pkg/transport go test -c -o /tmp/test --race=true ./ taskset -c 0 /tmp/test -test.run TestWriteReadTimeoutListener -test.v -test.cpu 4 -test.count=10000 -test.failfast ``` To fix this, suggest to use seperate `stop` channel to prevent from data race. Signed-off-by: Wei Fu <fuweid89@gmail.com>