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

pipeline job stuck with "Still waiting to schedule task" but node is idling and then whole queue stay in deadlock state

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • core, pipeline

      Update 2023-10-27 for LTS v2.414.3

      with Jenkins v2.414.3 this bug is now so massive:

      after each restart service goes into this corrupt state just in a few seconds
      -> Jenkins no longer usable for us
      => after downgrade back to 2.414.2 it is usable again
      => but still worse

      hint: we use extensively the Jenkins API to update labels and config of nodes (>150 nodes in parallel) to balance jobs, I think we found here a race condition

      some minutes after restart Jenkins Server service some pipeline job stuck in state "Still waiting to schedule task" and whole queue deadlock forever

      pipeline example:

      pipeline {
          agent { node { label params.nodename } }
          options { buildDiscarder(logRotator(numToKeepStr: '5000', artifactNumToKeepStr: '5000')) }
          parameters
          {
              string (name: 'nodename', defaultValue: '')
              string (name: 'commandLine', defaultValue: '')
              string (name: 'sourceBranch', defaultValue: 'master', description: '')
          }
          stages {
              stage('Execute') {
                  when {
                      beforeAgent true
                      expression { params.nodename != '' }
                  }
                  steps {
                      bat 'echo hello'
                  }
              }
          }
      }
      

      parameter example:
      nodename: VM-514A56DC0979

      node is connected and idling

      finally the whole jenkins queue deadlocks
      no progress until I restart the Jenkins Server service
      but after service restart and some minutes it stuck again in that state

      have also an observation what can be related to this:
      if I want to change configuration of that node it lead to an serious error in Jenkins

      see
      pipeline:

      pipeline job console log:

      parameter values:

      node state:

      queue deadlock:

      thread dump:

      Thread #0
      	at DSL.node(java.util.concurrent.ExecutionException: java.lang.ClassCastException)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.LabelScript.run(LabelScript.groovy:42)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:594)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:76)
      	at WorkflowScript.run(WorkflowScript:1)
      
      

      plugin version:

            Unassigned Unassigned
            thomaspatzig Thomas Patzig
            Votes:
            14 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: