private synchronized void reportDeadLocator(InetSocketAddress l, Exception ex) {
    Object prevState = locatorState.put(l, ex);
    if (prevState == null) {
      if (ex instanceof ConnectException) {
        logger.info("locator {} is not running.", l, ex);
      } else {
        logger.info("Communication with locator {} failed", l, ex);
      }
    }
  }
This method will add bad locator only when locator with hostname and port is not already in
list.
geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java