You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2025/09/23 20:30:25 UTC

[PR] RATIS-2336. PeerProxyMap.getProxy() could return null. [ratis]

szetszwo opened a new pull request, #1290:
URL: https://github.com/apache/ratis/pull/1290

   See RATIS-2336


-- 
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: issues-unsubscribe@ratis.apache.org

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


Re: [PR] RATIS-2336. PeerProxyMap.getProxy() could return null. [ratis]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on PR #1290:
URL: https://github.com/apache/ratis/pull/1290#issuecomment-3329808638

   @slfan1989 , @adoroszlai , thanks a lot for reviewing this!


-- 
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: issues-unsubscribe@ratis.apache.org

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


Re: [PR] RATIS-2336. PeerProxyMap.getProxy() could return null. [ratis]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo merged PR #1290:
URL: https://github.com/apache/ratis/pull/1290


-- 
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: issues-unsubscribe@ratis.apache.org

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


Re: [PR] RATIS-2336. PeerProxyMap.getProxy() could return null. [ratis]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@ratis.apache.org

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