Upgrading Jenkins LTS from 2.77 to 2.89 will change Quiet Period effective value from seconds into milliseconds.

      ex. 30 sec have to be configured now as 30000.

      Use Case:

      Set job Quiet Period value from UI. Trigger new build using REST API without delay parameter. 

      Reproduce steps:

      Step 1. Try Quiet period value 30:

      1. Install LTS 2.89.2
      2. Create new Freestyle project (ex. trigger_test-quiet_period)
      3. Add Quiet Period value to 30 (like in picture). (Quiet period can be found under Advanced.. button in general section)
      4. Save the job
      5. Build the job by using REST API or for the testing purpose just build directly from browser address bar
        1. http://<jenkins_address>/job/trigger_test-quiet_period/build 
          1. Link can be found by hovering mouse cursor over 
        2. Click proceed
      6. Go back to job page http://<jenkins_address>/view/test/job/trigger_test-quiet_period/

      Result: Quiet periods is 30ms. Build basically starts immediately.

      Excepted result: Quiet period is 30s
       

      Step 2. Try Quiet period value 30000:

      1. Use same job as in step 1
      2. Change Quiet Period value to 30000. (Quiet period can be found under Advanced.. button in general section)
      3. Save the job
      4. Build the job by using REST API or for the testing purpose just build directly from browser address bar
        1. http://<jenkins_address>/job/trigger_test-quiet_period/build
          1. Link can be found by hovering mouse cursor over 
        2. Click proceed
      5. Go back to job page http://<jenkins_address>/view/test/job/trigger_test-quiet_period/

      Result: Quiet periods is 30s

      Excepted result: Quiet period is over 8h

       

          [JENKINS-48770] Quiet period is in milliseconds

          Daniel Beck added a comment -

          jsalonso That should work as intended, pass a value such as 10sec instead, like the 'Build Now' link URL demonstrates. Do we need to fix some docs?

          Daniel Beck added a comment - jsalonso That should work as intended, pass a value such as 10sec instead, like the 'Build Now' link URL demonstrates. Do we need to fix some docs?

          Tapio Patteri added a comment -

          Description updated

          Tapio Patteri added a comment - Description updated

          Saul Alonso added a comment -

          danielbeck We have a external development (it can't be modified) that trigger builds via API with delay value without units (only number). With jenkins update to 2.89.2 it has stopped working.

          Saul Alonso added a comment - danielbeck We have a external development (it can't be modified) that trigger builds via API with delay value without units (only number). With jenkins update to 2.89.2 it has stopped working.

          Daniel Beck added a comment -

          jsalonso That's unfortunate but not a bug. In fact, the previous behavior was a bug.

          Daniel Beck added a comment - jsalonso That's unfortunate but not a bug. In fact, the previous behavior was a bug.

          Nobuhiro Ban added a comment -

          quietPeriod is integer and its unit is second.

          In 3hunks of https://github.com/jenkinsci/jenkins/commit/ff36adf0d243e2c3461045615ee654eb33665acb (JENKINS-44052),
          delay.getTime() was changed to delay.getTimeInSeconds().

          But this delay is created as new TimeDuration(xxx.getQuietPeriod()).
          This parameter should have to be changed to x1000.
          Now, if quietPeriod=5 then 5ms delay is created wrongly.

           

          Suggested fix:

          Change new TimeDuration(xxx.getQuietPeriod())
          to new TimeDuration(xxx.getQuietPeriod() * 1000L)
          in core/src/main/java/hudson/model/ParametersDefinitionProperty.java (2 places)
          and core/src/main/java/jenkins/model/ParameterizedJobMixIn.java.

          Nobuhiro Ban added a comment - quietPeriod is integer and its unit is second. In 3hunks of https://github.com/jenkinsci/jenkins/commit/ff36adf0d243e2c3461045615ee654eb33665acb ( JENKINS-44052 ), delay.getTime() was changed to delay.getTimeInSeconds() . But this delay is created as new TimeDuration(xxx.getQuietPeriod()) . This parameter should have to be changed to x1000. Now, if quietPeriod=5 then 5ms delay is created wrongly.   Suggested fix: Change new TimeDuration(xxx.getQuietPeriod()) to new TimeDuration(xxx.getQuietPeriod() * 1000L) in core/src/main/java/hudson/model/ParametersDefinitionProperty.java (2 places) and core/src/main/java/jenkins/model/ParameterizedJobMixIn.java.

          Daniel Beck added a comment -

          batmat Ping. Apparently quiet period broke.

          Daniel Beck added a comment - batmat Ping. Apparently quiet period broke.

          Alex Doan added a comment -

          Downstream job (pipeline "build job" method) also affected by this change. The value is expecting is seconds so when quiet period is in milliseconds, it cause downstream to take hours/days to build.

          Alex Doan added a comment - Downstream job (pipeline "build job" method) also affected by this change. The value is expecting is seconds so when quiet period is in milliseconds, it cause downstream to take hours/days to build.

          Oleg Nenashev added a comment -

          batmat ping

          Oleg Nenashev added a comment - batmat ping

          Unfortunately lacking the time to do this on personal time these days. Sorry

          Baptiste Mathus added a comment - Unfortunately lacking the time to do this on personal time these days. Sorry

          PR merged

          Francisco Fernández added a comment - PR merged

            fcojfernandez Francisco Fernández
            tpatteri Tapio Patteri
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: