Bug #3660

TTCN3 Jenkins jobs leave Docker containers running when stopped

Added by osmith 9 months ago. Updated 2 months ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


The scripts start multiple containers and stops them at the end of the script. When aborting a job with the web interface, the script gets killed and can not do the clean up part. Jenkins kills all child processes, but not the containers as they get spawned by the docker daemon.

Ideas to resolve this:
  • open a bug report at Jenkins to not kill processes with -9 in a bug report, then wait for a stable release with the fix, then implement clean up on receiving SIGABRT in
  • try out the PostBuildScript Plugin (or Post build task, that should work for sure), see if they allow executing code on abort of the job
  • try to attach the environment variable that jenkins is using to decide which processes will be killed (see link above) to the processes in the Docker containers


#1 Updated by laforge 2 months ago

please at the very least submit a bug report at Jenkins to get the discussion going upstream. If we had done that 7 months ago, a fix might already exist today.

#2 Updated by osmith 2 months ago

Sorry for the delay, I've done the research to prepare a bug report now. Turns out that a related pull request has been merged to jenkins master in August 2018 (so it must be in the version we are running already):

[JENKINS-17116] - When aborting a build, wait up to 2min for process termination

When a build is aborted by the user, Jenkins will now gracefully terminate involved processes by giving it up to 30 seconds time to exit after having received SIGTERM (on Linux) or Ctrl+C on Windows.

Here is the related issue:

The issue is in the "in review" state, which means they are waiting for people to confirm that it works as expected, as I understand. I have tested on our jenkins, whether this works, and it does not work. So I've replied in detail to that issue:

Test job result:

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)