Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3614

Unable to generate unique id when range of ports are blocked - org.apache.activemq.util.IdGenerator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.5.1
    • 5.6.0
    • Broker
    • None

    Description

      org.apache.activemq.util.IdGenerator is unable to generate a unique id if a range of ports have been block.
      Currently there is only one strategy create this id if the canAccessSystemProps condition is true:

      if (canAccessSystemProps) {
                  try {
                      hostName = InetAddressUtil.getLocalHostName();
                      ServerSocket ss = new ServerSocket(0);
                      stub = "-" + ss.getLocalPort() + "-" + System.currentTimeMillis() + "-";
                      Thread.sleep(100);
                      ss.close();
                  } catch (Exception ioe) {
                      LOG.warn("could not generate unique stub", ioe);
                  }
              } else {
                  hostName = "localhost";
                  stub = "-1-" + System.currentTimeMillis() + "-";
              }
      

      No fallback strategy has been implemented if the canAccessSystemProp evaluates to true

      Attachments

        1. AMQ3614.patch
          0.9 kB
          Jason Sherman

        Activity

          People

            gtully Gary Tully
            jsherman1 Jason Sherman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: