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

[PR] fix(cluster): return defensive copies and atomically update cluster config [rocketmq-dashboard]

yyqdbngt opened a new pull request, #1140:
URL: https://github.com/apache/rocketmq-dashboard/pull/1140

   `ClusterRepositoryImpl` exposed the cached `ClusterVO` objects directly from `findAll()`/`findById()`, so a caller could mutate the shared cache, and `updateConfig` mutated the stored object in two separate writes that concurrent readers could observe in between.
   
   - `findAll()`/`findById()` now return defensive copies (nested lists are copied with `new ArrayList` so even immutable sources produce a fresh list).
   - `updateConfig` replaces the stored cluster atomically via `computeIfPresent`, so readers never see a partially updated snapshot.
   - Added a unit test asserting the returned copy is independent.
   


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


Re: [PR] fix(cluster): return defensive copies and atomically update cluster config [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #1140:
URL: https://github.com/apache/rocketmq-dashboard/pull/1140


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