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

Fix DynamicLabels for the master node

XMLWordPrintable

    • Icon: Patch Patch
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      Dynamic labels on the master node are broken:

      • the first check is done when toComputer() returns null; the result is cached
        and no later checks are performed
      • lots of code is duplicated with hudson.model.Slave.

      The patch I'm attaching fixes this by:

      • consolidating the two connected variables dynamicLabels and
        dynamicInstanceHash into a single instance of a new class, fixing race
        conditions between the two and making code dealing with them cleaner
      • pulling the common code between Hudson and Slave for dealing with dynamic
        labels up into Node

      I hope the style etc is ok, please let me know if you need more changes done to
      be able to land the patch. I could see a bunch of improvements in the labelling
      area but I didn't want to make a bigger patch than needed to fix what we want to
      do in the squid project (where we want to tie jobs to the arch-os-version of
      nodes and we are entering it by hand at the moment).

      This patch would allow the OSLabeller to be enabled (I used it as a testbed),
      but it doesn't meet our project needs, and enabling it is a separate conceptual
      step - thus its been left disabled.

        1. dynamic-labels.patch
          11 kB
          lifeless
        2. dynamic-labels.patch
          8 kB
          lifeless

            Unassigned Unassigned
            lifeless lifeless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: