lhotari commented on code in PR #25067:
URL: https://github.com/apache/pulsar/pull/25067#discussion_r2611355471


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/BookieRackAffinityMapping.java:
##########
@@ -157,7 +158,9 @@ private void watchAvailableBookies() {
                 registrationClient.watchWritableBookies(versioned -> {
                     bookieMappingCache.get(BOOKIE_INFO_ROOT_PATH)
                             .thenApply(optRes -> 
optRes.orElseGet(BookiesRackConfiguration::new))
-                            .thenAccept(this::updateRacksWithHost)
+                            .thenApply(racks ->
+                                    processRackUpdate(racks, 
bookieAddressListLastTime)

Review Comment:
   accessing `bookieAddressListLastTime` isn't thread safe. It seems that 
making the field `volatile` would address the 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]

Reply via email to