Skip to content

WIP: Graceful docker container stopping

What does this MR do?

This tries to stop docker containers gracefully by using dockers stop method. Docker stop first sends sigterm and then sigkill after a timeout. The timeout could still be made configurable.

It also useful to combine this with !971 (closed) to enable cleanup traps in bash.

Why was this MR needed?

We're using privileged containers which may leave things around on the host. (currently nfs server processes) We also provision test-hardware and turn it off again using bash traps or child reaping docker entrypoints.

Are there points in the code the reviewer needs to double check?

I'm not familiar enough with go contexts. I've used context.TODO() to also run on canceled jobs.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

#6359 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports