Uploaded image for project: 'genius'
  1. genius
  2. GENIUS-98

InetAddress should not be used to get a unique bladeId

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • None

      genius currently uses a line roughtly similar to this:

      int bladeId = InetAddresses.coerceToInteger(InetAddress.getLocalHost());

      in at least 3 places (fcapsapp/NodeEventListener, ResourceManagerUtils, IdUtils & new LockManagerUtils in c/61526) but I believe this is not a good idea, because:

      A. if you ran x2 ODL instances next to each other on a host, for local or Cluster testing in some CI, or even in production in theory, then you would have the same bladeId... I do understand that in production the more typical deployment would be completely separate VMs (and jluhrsen says that's what clustered CSIT does as well), or containers. But it's still not great that we've basically hard-coded, in several places, that you HAVE to run them separated? Even though there would be port conflicts and what not... still not great, IMHO.

      B. InetAddress.getLocalHost() is known to have issues sometimes, see e.g. ODLPARENT-84 (and my related blog post), or this post from openflowplugin-dev or the comment from rovarga in ODLPARENT-35.

      Ideally, we should use another unique "bladeId" - I'm assuming that this really is trying to be is a unique ID of a node instance in a cluster, is it? If that's the case, then there must another more reliable and safer way to obtain something like that? Some controller API, perhaps? Something else native in the JVM, like.. its PID? Or some... random number??

            Unassigned Unassigned
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: