Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54489

Don't use RandomStringGenerator for suffix in instance name

    Details

    • Similar Issues:

      Description

      Plugin generate suffix for instance name randomly. At first glance, this is a good solution, but in the process of exploitation there are some shortcomings.
      1. If monitoring is used, for example, influxdb, then a huge number of unique hostnames accumulate and this greatly complicates monitoring.
      2. Monitoring in GCE is tied to the name of the instance, and by opening the monitoring tab you can see all the data of the instance with the same name for previous periods.
      3. You can use Commitments and discounts. It count instances with the same name like one and apply discounts.

      I suggest not to use a random name, but to use predefined names, to check whether such a name exists, and if not, to use it.
      Example of code:
      def nodes_list_to_add = []
      int i = 0
      int n = 0
      while ( i < number_of_nodes_to_add ) {
        n++
        node_name = node_name_template + '-' + sprintf('%03d', n)
        if (! nodes_map.containsKey(node_name)){
          nodes_list_to_add.add(node_name)
                i++
          }
      }

        Attachments

          Activity

          Hide
          ingwar Karol Lassak added a comment -

          I think its much easier to debug things when names are random (cause you should never have same twice in any place)

           

          But if 3rd point is valid (Im not sure about that, and after reading Google docs it seems its not..) then it would be great..

           

          The code you have added for getting next ID is rather waaay to simple.. inside many strange things happens and most of them is asynchronous..

          So it would have to involve a lot of locking and checking GCE to see if instance we want to create don't exists or previous one is already dead.

           

           

           

          Show
          ingwar Karol Lassak added a comment - I think its much easier to debug things when names are random (cause you should never have same twice in any place)   But if 3rd point is valid (Im not sure about that, and after reading Google docs it seems its not..) then it would be great..   The code you have added for getting next ID is rather waaay to simple.. inside many strange things happens and most of them is asynchronous.. So it would have to involve a lot of locking and checking GCE to see if instance we want to create don't exists or previous one is already dead.      

            People

            • Assignee:
              evanbrown Evan Brown
              Reporter:
              dubrsl Viacheslav Dubrovskyi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: