oxsean commented on code in PR #14057:
URL: https://github.com/apache/dubbo/pull/14057#discussion_r1560775056


##########
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/state/BitList.java:
##########
@@ -93,23 +93,23 @@ public BitList(List<E> originList, BitSet rootSet, List<E> 
tailList) {
     }
 
     // Provided by BitList only
-    public List<E> getOriginList() {
+    public synchronized List<E> getOriginList() {

Review Comment:
   In general, reading without locking may lead to consistency issues.
   @He-Pin If the operation itself is very short, using a read-write lock won't 
increase throughput. In fact, due to the internal complexity of the lock, it 
might even slow down. I've tested this with examples before.



-- 
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: notifications-unsubscr...@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to