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

Changing crontab settings blocks "configSubmit" for 3x60 seconds

    Details

    • Similar Issues:

      Description

      With recent disk-usage plugin (0.26+), changing the crontab expressions in the global settings will block Jenkins configuration for (up to) 180 seconds (when the 3 crontab settings are modified at once).

      Taking several thread-dumps when it happens shows, successively, the following three stacks:

      "Handling POST /jenkins/configSubmit from 127.0.0.1 : RequestHandlerThread[#14]" daemon prio=10 tid=0x00007f2c4820d000 nid=0x3311 waiting on condition [0x00007f2c2e7dd000]
         java.lang.Thread.State: TIMED_WAITING (sleeping)
      	at java.lang.Thread.sleep(Native Method)
      	at hudson.plugins.disk_usage.DiskUsageCalculation.reschedule(DiskUsageCalculation.java:101)
      	at hudson.plugins.disk_usage.DiskUsageProjectActionFactory$DescriptorImpl.configureBuildsCalculation(DiskUsageProjectActionFactory.java:359)
      	at hudson.plugins.disk_usage.DiskUsageProjectActionFactory$DescriptorImpl.configure(DiskUsageProjectActionFactory.java:293)
      	at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:2899)
      	at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:2862)
      ...
      
      "Handling POST /jenkins/configSubmit from 127.0.0.1 : RequestHandlerThread[#14]" daemon prio=10 tid=0x00007f2c4820d000 nid=0x3311 waiting on condition [0x00007f2c2e7dd000]
         java.lang.Thread.State: TIMED_WAITING (sleeping)
      	at java.lang.Thread.sleep(Native Method)
      	at hudson.plugins.disk_usage.DiskUsageCalculation.reschedule(DiskUsageCalculation.java:101)
      	at hudson.plugins.disk_usage.DiskUsageProjectActionFactory$DescriptorImpl.configureJobsCalculation(DiskUsageProjectActionFactory.java:369)
      	at hudson.plugins.disk_usage.DiskUsageProjectActionFactory$DescriptorImpl.configure(DiskUsageProjectActionFactory.java:294)
      	at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:2899)
      	at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:2862)
      ...
      
      "Handling POST /jenkins/configSubmit from 127.0.0.1 : RequestHandlerThread[#14]" daemon prio=10 tid=0x00007f2c4820d000 nid=0x3311 waiting on condition [0x00007f2c2e7dd000]
         java.lang.Thread.State: TIMED_WAITING (sleeping)
      	at java.lang.Thread.sleep(Native Method)
      	at hudson.plugins.disk_usage.DiskUsageCalculation.reschedule(DiskUsageCalculation.java:101)
      	at hudson.plugins.disk_usage.DiskUsageProjectActionFactory$DescriptorImpl.configureWorkspacesCalculation(DiskUsageProjectActionFactory.java:379)
      	at hudson.plugins.disk_usage.DiskUsageProjectActionFactory$DescriptorImpl.configure(DiskUsageProjectActionFactory.java:295)
      	at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:2899)
      	at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:2862)
      ...
      

      The offending commit is this one, which introduces a Thread.sleep(60000) in DiskUsageCalculation.reschedule():
      https://github.com/jenkinsci/disk-usage-plugin/commit/9ec92f4887032f3dadbe52f91a803b638fe7721e

      I don't understand (at all) the purpose of this sleep calls (is it some testing/debugging code which should have been removed before commit?), thus I'm not able to submit a PR.

      Thanks for having a look at this,
      Thomas.

        Attachments

          Activity

          Hide
          tom_gl Thomas de Grenier de Latour added a comment -

          I don't understand (at all) the purpose of this sleep calls (is it some testing/debugging code which should have been removed before commit?), thus I'm not able to submit a PR.

          Actually, since "it's testing code" is the only explanation I can think of, I've submitted a PR to drop it:
          https://github.com/jenkinsci/disk-usage-plugin/pull/37

          Show
          tom_gl Thomas de Grenier de Latour added a comment - I don't understand (at all) the purpose of this sleep calls (is it some testing/debugging code which should have been removed before commit?), thus I'm not able to submit a PR. Actually, since "it's testing code" is the only explanation I can think of, I've submitted a PR to drop it: https://github.com/jenkinsci/disk-usage-plugin/pull/37
          Hide
          lvotypkova Lucie Votypkova added a comment -

          Hi,
          this sleep time was because cron is only in minutes. I do not remember where the problem was exactly. It was before there was so many calculation threads. I will look at it, I believe there is better way how to do it (without so much sleeping).

          Show
          lvotypkova Lucie Votypkova added a comment - Hi, this sleep time was because cron is only in minutes. I do not remember where the problem was exactly. It was before there was so many calculation threads. I will look at it, I believe there is better way how to do it (without so much sleeping).
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Thomas de Grenier de Latour
          Path:
          src/main/java/hudson/plugins/disk_usage/DiskUsageCalculation.java
          http://jenkins-ci.org/commit/disk-usage-plugin/f0ffb21fc598d532a5094240ac5285521e7e29b4
          Log:
          JENKINS-30934 - remove dubious Thread.sleep(60000)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Thomas de Grenier de Latour Path: src/main/java/hudson/plugins/disk_usage/DiskUsageCalculation.java http://jenkins-ci.org/commit/disk-usage-plugin/f0ffb21fc598d532a5094240ac5285521e7e29b4 Log: JENKINS-30934 - remove dubious Thread.sleep(60000)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Lucie Votypkova
          Path:
          src/main/java/hudson/plugins/disk_usage/DiskUsageCalculation.java
          http://jenkins-ci.org/commit/disk-usage-plugin/8ca492d321ad1df66e77b7b6fe0b3c1ea6a97ce5
          Log:
          Merge pull request #37 from thomasgl-orange/dont-Thread-sleep

          JENKINS-30934 - remove dubious Thread.sleep(60000)

          Compare: https://github.com/jenkinsci/disk-usage-plugin/compare/4855568b75ab...8ca492d321ad

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Lucie Votypkova Path: src/main/java/hudson/plugins/disk_usage/DiskUsageCalculation.java http://jenkins-ci.org/commit/disk-usage-plugin/8ca492d321ad1df66e77b7b6fe0b3c1ea6a97ce5 Log: Merge pull request #37 from thomasgl-orange/dont-Thread-sleep JENKINS-30934 - remove dubious Thread.sleep(60000) Compare: https://github.com/jenkinsci/disk-usage-plugin/compare/4855568b75ab...8ca492d321ad
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The fix has been integrated towards 0.29

          Show
          oleg_nenashev Oleg Nenashev added a comment - The fix has been integrated towards 0.29

            People

            • Assignee:
              lvotypkova Lucie Votypkova
              Reporter:
              tom_gl Thomas de Grenier de Latour
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: