maple525866 commented on code in PR #7719:
URL: https://github.com/apache/incubator-seata/pull/7719#discussion_r2448765389


##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -90,7 +92,8 @@ public abstract class AbstractNettyRemotingClient extends 
AbstractNettyRemoting
 
     private final CopyOnWriteArrayList<ChannelEventListener> 
channelEventListeners = new CopyOnWriteArrayList<>();
 
-    protected final Object mergeLock = new Object();
+    protected final ReentrantLock mergeLock = new ReentrantLock();

Review Comment:
   You changed `mergeLock` from Object to ReentrantLock, and changed it to 
lock()/await()/signalAll()/unlock() in two places - this is the right approach, 
but you must make sure that the code base has no other residual 
synchronized(mergeLock) / mergeLock.wait()/notify() usage. Mixing will lead to 
strange race conditions or IllegalMonitorState (calling wait/notify without 
holding monitor)



-- 
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