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

Swarm Client should not restart when labelsFile changes

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • swarm-plugin
    • None
    • Jenkins 2.90
      Swarm Plugin and Jar: 3.6

      Currently when -labelsFile file changes, the client is blindly restarted, interrupting any running jobs.  In my opinion, the only advantage of -labelsFile flag is to eliminate the need to restart the client for label changes and therefore avoid interrupting jobs.

      Currently my puppet instrumentation updates the init.d script with any changes to the -labels parameter and then restarts the system service.  In order to avoid job interruptions I had to write my own logic that detects the number of running jobs, sets the slave temporarily offline, restarts it once jobs finish, etc.  I doubt that my needs are unusual.  In this context, the new -labelsFile parameter is not a useful addition unless it can handle all of that.

      In other words, it should either:

      1. Not restart the client but update labels on the fly.
      2. Restart the client gracefully (when no jobs are running).

       (Note that this is different from JENKINS-45295 where the client stays down for some reason)

          [JENKINS-48247] Swarm Client should not restart when labelsFile changes

          Oleg Nenashev added a comment -

          KK does not maintain this plugin anymore. Moving to unassigned to set the expectation

          Oleg Nenashev added a comment - KK does not maintain this plugin anymore. Moving to unassigned to set the expectation

          Basil Crow added a comment -

          Duplicate of JENKINS-45295.

          Basil Crow added a comment - Duplicate of JENKINS-45295 .

          Basil Crow added a comment -

          Can you try using -disableClientsUniqueId as a temporary workaround?

          Basil Crow added a comment - Can you try using -disableClientsUniqueId as a temporary workaround?

          Basil Crow added a comment -

          Fixed in #110 and will be released in 3.17.

          Basil Crow added a comment - Fixed in #110 and will be released in 3.17.

          Basil Crow added a comment -

          Released in 3.17.

          Basil Crow added a comment - Released in 3.17.

          Thanks basil!
          I am in fact using -disableClientsUniqueId, but I must not have been when I tested this behavior back in 2017.
          I just tested and reloading the file works correctly even in 3.15 with that switch, as you pointed out in the PR.

          Alexander Komarov added a comment - Thanks basil ! I am in fact using -disableClientsUniqueId , but I must not have been when I tested this behavior back in 2017. I just tested and reloading the file works correctly even in 3.15 with that switch, as you pointed out in the PR.

            Unassigned Unassigned
            akom Alexander Komarov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: