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

Docker stop should allow 143 as a valid exit code

XMLWordPrintable

      I had randomly occurring docker steps failing in my Jenkins pipeline jobs.

      I instrumented the error messages to show the error code, stdout & stderr when the error is triggered.

      I got the following on termination of the job:

      Failed to kill container '48118b1b0a9c91345aa06c2b12a0680c13093a2a7b850e6d7fe7cd314409305c'. Error 143: '',''

       

      On further research, "docker stop" sends a SIGTERM to the child processes, which may result in the docker image terminating with an exit code of 143 (SIGTERM). Some discussion here:

      https://github.com/docker-library/tomcat/issues/57

      https://github.com/neo4j/docker-neo4j/issues/30

       

      I think that 143 should be allowed as a valid exit code.

       

       

      Here is the relevant snippet invoking docker:

      docker.image(dockerContainer).inside {
      checkout scm
      sh "cd linux && ARCH=powerpc make pseries_le_defconfig"
      sh "cd linux && ARCH=powerpc make olddefconfig"
      sh "cd linux && ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- make prepare"
      sh "cd linux && ARCH=powerpc make headers_install"
      sh "cppcheck --quiet --enable=all --xml-version=2 --std=c11 -j\$(nproc) $args \
      -I linux/include -I linux/arch/powerpc/include -I linux/arch/powerpc/include/uapi \
      -I linux/include/uapi -I linux/arch/powerpc/include/generated \
      -D_KERNEL_ -U_ASSEMBLY_ \
      $dir 2> $reportFile"

      archiveArtifacts fingerprint: true, artifacts: reportFile

      stash includes: reportFile, name: reportFile
      cppcheckReports.push(reportFile)
      }

            evildeece Alastair D'Silva
            evildeece Alastair D'Silva
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: