durable-tasks issue when running the parallel step

17 views
Skip to first unread message

Victor Martinez

unread,
Oct 11, 2019, 10:20:15 AM10/11/19
to Jenkins Developers
Hi there,

Not sure whether this is related to https://github.com/jenkinsci/durable-task-plugin/pull/98 or something else, in any case I've raised https://issues.jenkins-ci.org/browse/JENKINS-59668 recently, but worth to mention here that I managed to narrow down when it happens, the below snippet shows that when running the parallel within the stage using two different methods causes nohup: failed to run command 'sh': No such file or directory ... process apparently never started in ...@tmp/durable-29eb87c3

pipeline {
  agent { label 'linux' }
...
  stages {
    stage('Test') {
       steps {
          script {
            def parallelTasks = [:]
            parallelTasks["linux"] = generateLinux()
            parallelTasks["windows"] = generateLinux()
            parallel(parallelTasks)
          }
       }
    }
  }
}


def generateLinux() {
  return {
    node('linux'){
      try {
      // whatever
      }catch(e){
        error(e.toString())
      } finally {
        docker.image('node:12').inside("-v ${WORKSPACE}/${BASE_DIR}:/app"){
          sh '...'
        }
      }
    }
  }
}

def generateWindows
(){
  return {
    node('windows'){
      // whatever
    }
  }
}



While if I do run two different stages one for each method then no issues at all, so apparently the parallel does something tricky with the tasks internally, see the below snippet:

pipeline {
  agent { label 'linux' }
...
  stages {
    stage('Test') {
       steps {
          script {
            def parallelTasks = [:]
            parallelTasks["linux"] = generateLinux()
          }
       }
    }
    stage('TestWindows') {
       steps {
          script {
            def parallelTasks = [:]
            parallelTasks["windows"] = generateWindows()
          }
       }
    }
  }
}


def generateLinux() {
  return {
    node('linux'){
      try {
      // whatever
      }catch(e){
        error(e.toString())
      } finally {
        docker.image('node:12').inside("-v ${WORKSPACE}/${BASE_DIR}:/app"){
          sh '...'
        }
      }
    }
  }
}

def generateWindows
(){
  return {
    node('windows'){
      // whatever
    }
  }
}


Even though I raised the above ticket, I wanted to share with you this particular use case as it seems really awkward. 


Mark Waite

unread,
Oct 11, 2019, 10:26:28 AM10/11/19
to jenkinsci-dev
If your first code sample is an accurate representation of the code you're using, then you probably need to change:

parallelTasks["windows"] = generateLinux()

to 

parallelTasks["windows"] = generateWindows()



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/dee0e222-5574-48df-b3bd-35d53803ff9c%40googlegroups.com.


--
Thanks!
Mark Waite

Victor Martinez

unread,
Oct 11, 2019, 4:05:21 PM10/11/19
to Jenkins Developers
Thanks Mark, actually it was a typo in the code sample. :)
Reply all
Reply to author
Forward
0 new messages