You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Senrian (via GitHub)" <gi...@apache.org> on 2026/04/06 05:59:36 UTC

Re: [PR] [Bug] Fix TOCTOU race condition in MQClientInstance.brokerVersionTable access [rocketmq]

Senrian commented on PR #10235:
URL: https://github.com/apache/rocketmq/pull/10235#issuecomment-4190592043

   Hi @Kris20030907, thank you for the review. Could you clarify which specific change you are concerned about? The `computeIfAbsent` pattern used here is a standard ConcurrentHashMap atomic operation and is actually the recommended approach for this type of race condition (check-then-act on a map entry). It avoids the performance overhead of synchronized blocks while ensuring thread-safety. Would you prefer a different approach, such as using `synchronized` blocks or accepting the race condition?


-- 
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: commits-unsubscribe@rocketmq.apache.org

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