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

Parameters: NPE in canTake() procedures may kill all executors

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • core
    • Jenkins ver. 1.466.1
      Linux buildserver 2.6.18-164.11.1.el5PAE #1 SMP Wed Jan 6 13:43:57 EST 2010 i686 i686 i386 GNU/Linux

    Description

      Jenkins executors are not robust against nulls returned by createValue() and createDefaultValue(). Such return value is valid according to Javadoc.

      NPE in canTake() procedure kills the executor thread. Unfortunately, Jenkins tries other executors after that => any NPE in canTake() terminates ALL active Jenkins executors.

      The initial description from Rotem:

      when using jenkins-multijob-plugin and parameter from type “File Parameter” the Jenkins crashes.
      When i start to run a Multijob with a multijob phase with values in "Advanced: "parameters", if the next job has a parameter from type “File Parameter” Jenkins is eating up all the executers with - ALL available Build executors are turning into zombies with the status 'Dead ' with the exception:

      java.lang.NullPointerException
      at hudson.model.ParametersAction.getAssignedLabel(ParametersAction.java:126)
      at hudson.model.Queue$Item.getAssignedLabel(Queue.java:1265)
      at hudson.model.Node.canTake(Node.java:308)
      at hudson.model.Queue$JobOffer.canTake(Queue.java:210)
      at hudson.model.Queue.maintain(Queue.java:952)
      at hudson.model.Queue.pop(Queue.java:783)
      at hudson.model.Executor.grabJob(Executor.java:287)
      at hudson.model.Executor.run(Executor.java:208)

      Even if at this stage I go to the settings and enlarge the number of Executors, they immediately turn into zombies as well.
      When I remove the specific “File Parameter” parameter all works fine.
      Please advice.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            changelog.html
            http://jenkins-ci.org/commit/jenkins/00292ff44c38a4d6c1423020f13f97e48efd7bad
            Log:
            Marking JENKINS-15094 major bug

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: changelog.html http://jenkins-ci.org/commit/jenkins/00292ff44c38a4d6c1423020f13f97e48efd7bad Log: Marking JENKINS-15094 major bug
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3425
            JENKINS-15094 - Unit tests for the issue (Revision cd23fac9950c1c0762731372df2c109d4bb80db3)
            [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI). (Revision 7b894f57b78be0e4d847fe1c971955d2cbb08e58)

            Result = SUCCESS
            o.v.nenashev : cd23fac9950c1c0762731372df2c109d4bb80db3
            Files :

            • core/src/test/java/hudson/model/ParametersActionTest.java
            • test/src/test/groovy/hudson/cli/BuildCommandTest.groovy

            o.v.nenashev : 7b894f57b78be0e4d847fe1c971955d2cbb08e58
            Files :

            • core/src/main/java/hudson/model/ParametersAction.java
            • core/src/main/java/hudson/cli/BuildCommand.java
            • core/src/main/java/hudson/model/ParametersDefinitionProperty.java
            • core/src/main/java/hudson/model/ParameterDefinition.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3425 JENKINS-15094 - Unit tests for the issue (Revision cd23fac9950c1c0762731372df2c109d4bb80db3) [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI). (Revision 7b894f57b78be0e4d847fe1c971955d2cbb08e58) Result = SUCCESS o.v.nenashev : cd23fac9950c1c0762731372df2c109d4bb80db3 Files : core/src/test/java/hudson/model/ParametersActionTest.java test/src/test/groovy/hudson/cli/BuildCommandTest.groovy o.v.nenashev : 7b894f57b78be0e4d847fe1c971955d2cbb08e58 Files : core/src/main/java/hudson/model/ParametersAction.java core/src/main/java/hudson/cli/BuildCommand.java core/src/main/java/hudson/model/ParametersDefinitionProperty.java core/src/main/java/hudson/model/ParameterDefinition.java
            oleg_nenashev Oleg Nenashev added a comment - - edited For backporting: https://github.com/jenkinsci/jenkins/pull/1229 Commits: Unit test: https://github.com/jenkinsci/jenkins/commit/cd23fac9950c1c0762731372df2c109d4bb80db3 The issue fix: https://github.com/jenkinsci/jenkins/commit/7b894f57b78be0e4d847fe1c971955d2cbb08e58

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/test/java/hudson/model/ParametersActionTest.java
            test/src/test/groovy/hudson/cli/BuildCommandTest.groovy
            http://jenkins-ci.org/commit/jenkins/5cfcebf722ed027cb9dbbd1b5b3142196fc58161
            Log:
            JENKINS-15094 - Unit tests for the issue

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
            (cherry picked from commit cd23fac9950c1c0762731372df2c109d4bb80db3)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/test/java/hudson/model/ParametersActionTest.java test/src/test/groovy/hudson/cli/BuildCommandTest.groovy http://jenkins-ci.org/commit/jenkins/5cfcebf722ed027cb9dbbd1b5b3142196fc58161 Log: JENKINS-15094 - Unit tests for the issue Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> (cherry picked from commit cd23fac9950c1c0762731372df2c109d4bb80db3)

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/cli/BuildCommand.java
            core/src/main/java/hudson/model/ParameterDefinition.java
            core/src/main/java/hudson/model/ParametersAction.java
            core/src/main/java/hudson/model/ParametersDefinitionProperty.java
            http://jenkins-ci.org/commit/jenkins/b6b94ea5e7a89068728c0a65e6323ca6991c7ddb
            Log:
            [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI).

            The change adds missing checks for null ParameterValue, which may be passed from the CLI.
            It prevents the death of Jenkins executors during the canTake() check of node labels.

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
            (cherry picked from commit 7b894f57b78be0e4d847fe1c971955d2cbb08e58)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/cli/BuildCommand.java core/src/main/java/hudson/model/ParameterDefinition.java core/src/main/java/hudson/model/ParametersAction.java core/src/main/java/hudson/model/ParametersDefinitionProperty.java http://jenkins-ci.org/commit/jenkins/b6b94ea5e7a89068728c0a65e6323ca6991c7ddb Log: [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI). The change adds missing checks for null ParameterValue, which may be passed from the CLI. It prevents the death of Jenkins executors during the canTake() check of node labels. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> (cherry picked from commit 7b894f57b78be0e4d847fe1c971955d2cbb08e58)

            People

              oleg_nenashev Oleg Nenashev
              rotem Rotem G
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: