Alanxtl commented on PR #3612:
URL: https://github.com/apache/dubbo-go/pull/3612#issuecomment-5351888150

   > 执行`make 
test-race`时,`TestCacheListenerRemoveListenerDropsWatchAtAutoLimit`和`TestRestartCallBackResetsCache`发生了数据竞争;原因是单测中执行到`defer
 cluster.Stop()`时,停止 ZooKeeper 
服务端,接着`Conn.loop`检测到网络断开,触发的`setState`与`removeWatcher()`中的`invalidateWatcher()`存在并发访问窗口,发生了state的读写竞争(前者是原子写,但后者却是普通读);由于后来reviewer提出要引入zk服务端依赖,这个数据竞争问题得以才暴露出来;
   > 
   > 
若要解决这个问题,可以在dubbogo/go-zookeeper中将`invalidateWatcher`的state读取改为已有的原子读取`State()`即可,是否需要我去`dubbogo/go-zookeeper`那提个pr改一下这个小问题?
   
   提一下吧


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to