Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8955

WAN location service uses DistributedLocatorId.toString() to represent a locator

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.15.0
    • wan

    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mkevo Mario Kevo
            bschuchardt Bruce J Schuchardt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment