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

Jenkins pipeline stucked infinity when closure return from class run

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • pipeline
    • None

      When I run closure that returned by class in Jenkins pipeline, Jenkins stucked in shell command like below.

       

      The script is

       

      class Device
      {
      def context

      public Device(context)

      { this.context = context }

      @NonCPS
      def buildDriver()
      {
      return ({
      context.stage("Build Driver")
      {
      context.script

      { context.print("111111111111") context.sh("pwd;") context.print("222222222222") context.sh("ls -al") context.print("333333333333") }

      }

      })
      }
      }

      dev = new Device(this)

      pipeline
      {
      agent any
      stages
      {
      stage("main stage")
      {
      steps
      {
      script

      { print("start script") dev.buildDriver().run() }

      }
      }

      }
      }

       

      {{}}

      I think when finish processing shell command, PC is not back to previous pointer.. Just stay in it.. How can I resolve this issue

            Unassigned Unassigned
            munga0828 hyunjun kim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: