Skip to content

Conversation

cwangg897
Copy link
Contributor

Change condition from != null to == null to only fetch clusterId
when it's not already set.
This avoids unnecessary broker calls and improves
performance while maintaining consistency with clusterId() method

Change condition from != null to == null to only fetch clusterId when
it's not already set. This avoids unnecessary broker calls and improves
performance while maintaining consistency with clusterId() method

Signed-off-by: Choi Wang Gyu <[email protected]>
@@ -300,7 +301,7 @@ public final boolean initialize() {
private void updateClusterId(Admin adminClient) throws InterruptedException, ExecutionException, TimeoutException {
try {
this.clusterIdLock.lock();
if (this.clusterId != null) {
if (this.clusterId == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original change is this: c84d0f7.
According to its logic this indeed has to be == null.
So, i treat this as a simple omission and schedule for back-port.
Thank you for spotting and fixing!

@artembilan artembilan added this to the 4.0.0-M4 milestone Jul 28, 2025
@artembilan artembilan enabled auto-merge (squash) July 28, 2025 14:58
@artembilan artembilan merged commit 052bed7 into spring-projects:main Jul 28, 2025
3 checks passed
spring-builds pushed a commit that referenced this pull request Jul 28, 2025
Fixed: #4027

Change condition from `!= null` to `== null` to only fetch `clusterId` when it's not set yet.
This avoids unnecessary broker calls and improves performance while maintaining consistency with `clusterId()` method

This is a fix for an important omission after #2859

Signed-off-by: Choi Wang Gyu <[email protected]>

(cherry picked from commit 052bed7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants