Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
This code in LocatorHelper, and probably code in other parts of the WAN location service, uses DistributionLocatorId.toString() to track whether other locators have the WAN location service available. It should use the DistributionLocatorId.marshal() method instead. We should never use the toString() representation of an object in this way as it may change over time.
private static void addServerLocator(Integer distributedSystemId, LocatorMembershipListener locatorListener, DistributionLocatorId locator) { ConcurrentHashMap<Integer, Set<String>> allServerLocatorsInfo = (ConcurrentHashMap<Integer, Set<String>>) locatorListener.getAllServerLocatorsInfo(); Set<String> locatorsSet = new CopyOnWriteHashSet<String>(); locatorsSet.add(locator.toString()); Set<String> existingValue = allServerLocatorsInfo.putIfAbsent(distributedSystemId, locatorsSet); if (existingValue != null) { if (!existingValue.contains(locator.toString())) { existingValue.add(locator.toString()); } } }
Attachments
Issue Links
- causes
-
GEODE-10127 Incorrect locator hostname used in remote locator connections
- Closed
- links to