Closed vrancurel closed 5 months ago
Thanks for your feedback!
For *nix, each num of fd is unique at the same time, so, it's safe for us to visit the connsUnix by fd as index, extra Mutex would be just used for race fixing but not useful and waste more CPU cost.
We tried to disable the warning by go:norace
but gave up finally.
For the shutdown
, it's a state check, extra Mutex just fix the race warning but useless for logic and waste more CPU cost.
There are more race conditions, I don't want to avoid them by extra Mutex. If really need to do it, I think "go:norace" to ignore the warnings is better.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
I discovered a few potential race conditions when running with
-race
option:connsUnix[]
, the problem is present I think in the other engines too.(g *Engine) Stop()
when iterating overconnsUnix
(linked to above race)shutdown
flag at(p *poller) stop()
which races withacceptorLoop
test forshutdown
.You could see an attempt to fix them in this branch. Would it be possible to have a clean fix ? Thx