• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • None
    • jenkins 2.54 lockable resources plugin 2.0

      We are doing automated regression testing with jenkins and using the lockable resources plugin to run one test job at a time. But sometimes it fails to acquire the lock on the testing system and one or more test job starts before the first one finished depending on when the lockable resource plugin starts to work again. Example wrong behavior:
      17:09:23 Started by timer

      17:09:23 [lockable-resources] acquired lock on []

      17:09:23 [EnvInject] - Loading node environment variables.
      Please tell me what kind of logs do you need to debug this issue.

          [JENKINS-43574] Lockable resources plugin does not take effect

          Bela Szanics created issue -

          Bela Szanics added a comment - - edited

          Tried it with resource name and label but the same issue happens. The problem started to happen after the upgrade to 2.0 so we plan to downgrade to 1.12.1 and will check what happens.

          Bela Szanics added a comment - - edited Tried it with resource name and label but the same issue happens. The problem started to happen after the upgrade to 2.0 so we plan to downgrade to 1.12.1 and will check what happens.

          Pavel Bekkerman added a comment - - edited

          I believe this is connected to: https://github.com/jenkinsci/lockable-resources-plugin/issues/24 .

          (The strange thing to me is: I've never had problems before with Lockable Resources, till I started working with Generated Jobs - and try to lock 'em.)

          Also I upgraded recently to 2.46.1. Before, Lockables worked fine with 2.x versions - not with Generated Jobs though - haven't tried back than. 

          Any idea how to solve it? A workaround? 

          Pavel Bekkerman added a comment - - edited I believe this is connected to: https://github.com/jenkinsci/lockable-resources-plugin/issues/24  . (The strange thing to me is: I've never had problems before with Lockable Resources, till I started working with Generated Jobs - and try to lock 'em.) Also I upgraded recently to 2.46.1. Before, Lockables worked fine with 2.x versions - not with Generated Jobs though - haven't tried back than.  Any idea how to solve it? A workaround? 

          Pavel Bekkerman added a comment - - edited

          Workaround: downgrade to ver. 1.11.2 of the plugin.

          Now timeout doesn't occur after 1 minute.

          Pavel Bekkerman added a comment - - edited Workaround: downgrade to ver. 1.11.2 of the plugin. Now timeout doesn't occur after 1 minute.

          Bela Szanics added a comment - - edited

          Hi,

          >I believe this is connected to: https://github.com/jenkinsci/lockable-resources-plugin/issues/24 .

          Yes, I've also found this bug but this bug is really old and my problems started after I upgraded to the latest version. I checked the diff between the releases and noticed that the lock queue related methods got some refactoring. Probably a bug was introduced there.

          My findings on this issue so far:

          This issue is  really weird because we have 3 resource for our 3 different release and this problem only happens with one of them but it happens constantly with that one after the jenkins/plugin upgrade(we also did both). Tried to harmonize  the job configuration for the three release(the faulty one used resource name instead of label and the resource name contained underscore instead of spaces) but the bug still occurs. So I tried to downgrade the plugin but the problem still occurred with labels so I tested it with resource name and it seems like it works(so far). Although I had to revert the changes on the resource name(the job seems to be split the resource name along the spaces so it couldn't find it when space is used. This seems to be another bug in the plugin since as I said the other resources are have this naming convention and the plugin could find it with the label.)

           Br,

          Bela

           

          Bela Szanics added a comment - - edited Hi, >I believe this is connected to: https://github.com/jenkinsci/lockable-resources-plugin/issues/24  . Yes, I've also found this bug but this bug is really old and my problems started after I upgraded to the latest version. I checked the diff between the releases and noticed that the lock queue related methods got some refactoring. Probably a bug was introduced there. My findings on this issue so far: This issue is  really weird because we have 3 resource for our 3 different release and this problem only happens with one of them but it happens constantly with that one after the jenkins/plugin upgrade(we also did both). Tried to harmonize  the job configuration for the three release(the faulty one used resource name instead of label and the resource name contained underscore instead of spaces) but the bug still occurs. So I tried to downgrade the plugin but the problem still occurred with labels so I tested it with resource name and it seems like it works(so far). Although I had to revert the changes on the resource name(the job seems to be split the resource name along the spaces so it couldn't find it when space is used. This seems to be another bug in the plugin since as I said the other resources are have this naming convention and the plugin could find it with the label.)  Br, Bela  

          I had only one resource, and no special chars in either resource/label name.

          So, the downgrade to 1.11.2 just brought it back to normal.

          Pavel Bekkerman added a comment - I had only one resource, and no special chars in either resource/label name. So, the downgrade to 1.11.2 just brought it back to normal.

          We had the same problem, with one of our 5 lockable resources. We downgraded to 1.11.2 and updated all configuration using the plugin and everything is working like before.

          Patrick Visser added a comment - We had the same problem, with one of our 5 lockable resources. We downgraded to 1.11.2 and updated all configuration using the plugin and everything is working like before.

          Also same problem with 2.0, generated jobs.

          At first, one job holds the resource, the other one waits, resource is showing as queued.

          After a short delay, the second job suddenly starts, the resource itself switches to "unlocked" state, and the second job shows the empty brackets: [].

          Now both jobs are running simulataniously and the resource is incorrectly unlocked.

          Andreas Ringlstetter added a comment - Also same problem with 2.0, generated jobs. At first, one job holds the resource, the other one waits, resource is showing as queued. After a short delay, the second job suddenly starts, the resource itself switches to "unlocked" state, and the second job shows the empty brackets: []. Now both jobs are running simulataniously and the resource is incorrectly unlocked.
          Andreas Ringlstetter made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]

          Andreas Ringlstetter added a comment - - edited

          For cross reference: https://github.com/jenkinsci/lockable-resources-plugin/issues/54

          debfx pointed out that version 2.0 creates invalid configurations:

              <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin="lockable-resources@1.11.2">
                <resourceNames>ResX ResY</resourceNames>
                <resourceNamesVar></resourceNamesVar>
                <resourceNumber></resourceNumber>
                <labelName></labelName>
              </org.jenkins.plugins.lockableresources.RequiredResourcesProperty

          while the previous version serialized into a configuration like this:

              <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin="lockable-resources@1.11.2">
                <resourceNames>ResX ResY</resourceNames>
              </org.jenkins.plugins.lockableresources.RequiredResourcesProperty>

          Note how the missing (nulled) options were replaced by empty options instead?

          Unbreaking the configuration also works again with 2.0. Using the broken 2.0 configuration with 1.11.2 also triggers the bug.

          Andreas Ringlstetter added a comment - - edited For cross reference: https://github.com/jenkinsci/lockable-resources-plugin/issues/54 debfx pointed out that version 2.0 creates invalid configurations: <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin= "lockable-resources@1.11.2" > <resourceNames>ResX ResY</resourceNames> <resourceNamesVar></resourceNamesVar> <resourceNumber></resourceNumber> <labelName></labelName> </org.jenkins.plugins.lockableresources.RequiredResourcesProperty while the previous version serialized into a configuration like this: <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin= "lockable-resources@1.11.2" > <resourceNames>ResX ResY</resourceNames> </org.jenkins.plugins.lockableresources.RequiredResourcesProperty> Note how the missing (nulled) options were replaced by empty options instead? Unbreaking the configuration also works again with 2.0. Using the broken 2.0 configuration with 1.11.2 also triggers the bug.

            Unassigned Unassigned
            szanics Bela Szanics
            Votes:
            11 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: