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

Warnings plugin with custom parsers massively slows down jenkins start up

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • warnings-plugin

      Having specified custom parsers in the general jenkins configuration results in a massive slow down of the start up procedure of our jenkins server. Instead of a few seconds the startup takes probably longer than 20 minutes.

      We have attached a visualvm to the JVM running jenkins and found out that the reason for the massive slow down is that the threads loading the jobs on startup are most of the time in the BLOCKED state. A thread dump is attached. All blocked threads basiclaly hang in the compilation of the defined custom parsers using groovy. Strangely, even jobs which use the warnings plugin, but not the custom parsers seem to invoke a compilation of the custom parsers and it also seems the the compiled parsers aren't shared between jobs at all, so each custom parsers is compiled for each job.

          [JENKINS-16107] Warnings plugin with custom parsers massively slows down jenkins start up

          This is a quick patch we did to our local installation which caches the parsers. However, due to the static initialization of most of the plugin registration, changes in the parser configuration require a restart of jenkins now. This patch mainly serves the purpose to demonstrate that the repeated compiling really is the issue.

          Johannes Wienke added a comment - This is a quick patch we did to our local installation which caches the parsers. However, due to the static initialization of most of the plugin registration, changes in the parser configuration require a restart of jenkins now. This patch mainly serves the purpose to demonstrate that the repeated compiling really is the issue.

          Ulli Hafner added a comment -

          Thanks for analyzing... Shouldn't be too complicated to cache the custom parsers.

          Ulli Hafner added a comment - Thanks for analyzing... Shouldn't be too complicated to cache the custom parsers.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/GroovyParser.java
          src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
          http://jenkins-ci.org/commit/warnings-plugin/d677b1f5d9f15275884b17cb705c032ac74eae47
          Log:
          Merge pull request #15 from jglick/JENKINS-16526

          [FIXED JENKINS-16526] [FIXED JENKINS-16107] Cache parsers after creation.

          Compare: https://github.com/jenkinsci/warnings-plugin/compare/6a770de735b1...d677b1f5d9f1


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/GroovyParser.java src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java http://jenkins-ci.org/commit/warnings-plugin/d677b1f5d9f15275884b17cb705c032ac74eae47 Log: Merge pull request #15 from jglick/ JENKINS-16526 [FIXED JENKINS-16526] [FIXED JENKINS-16107] Cache parsers after creation. Compare: https://github.com/jenkinsci/warnings-plugin/compare/6a770de735b1...d677b1f5d9f1 – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/GroovyParser.java
          src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
          http://jenkins-ci.org/commit/warnings-plugin/2987adb60b54e0a0b471ba2c3e14384d680ba930
          Log:
          Improved fix for JENKINS-15526[FIXED JENKINS-16107].

          Compare: https://github.com/jenkinsci/warnings-plugin/compare/d677b1f5d9f1...2987adb60b54


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/GroovyParser.java src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java http://jenkins-ci.org/commit/warnings-plugin/2987adb60b54e0a0b471ba2c3e14384d680ba930 Log: Improved fix for JENKINS-15526 [FIXED JENKINS-16107] . Compare: https://github.com/jenkinsci/warnings-plugin/compare/d677b1f5d9f1...2987adb60b54 – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          An enormous improvement on rendering web pages for projects defining custom parsers after installing Warnings 4.21. Many thanks!

          Andrew Gvozdev added a comment - An enormous improvement on rendering web pages for projects defining custom parsers after installing Warnings 4.21. Many thanks!

            drulli Ulli Hafner
            languitar Johannes Wienke
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: