slfan1989 commented on code in PR #1290:
URL: https://github.com/apache/ratis/pull/1290#discussion_r2374456379
##########
ratis-common/src/main/java/org/apache/ratis/util/PeerProxyMap.java:
##########
@@ -59,7 +59,10 @@ RaftPeer getPeer() {
}
PROXY getProxy() throws IOException {
- if (proxy == null) {
+ final PROXY p = proxy;
Review Comment:
Thanks for the fix! You’re right — returning the value outside the
synchronized block could allow another thread to set it to null. This change
nicely addresses that concurrency issue.
--
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]