bazooka-ci / bazooka

Continuous Integration and Continuous Deployment Server
http://docs.bazooka-ci.io/
MIT License
60 stars 5 forks source link

Container leak when using services #271

Closed julienvey closed 8 years ago

julienvey commented 9 years ago

From https://github.com/bazooka-ci/bazooka/pull/269#issuecomment-147506713

Given a job with 3 services A, B and C:

  • if A and B creation succeeds, and C's creation fails, we return without stopping A and B
  • if the varian't container cannot be started none of A, B or C is stopped or removed
  • same if we can't wait for the the variant container to run
  • same if the exit code is <> 0
  • or if we can't remove the variant's container
  • if one service container removing fails, the following ones are not removed

One easy fix is to use defer: for every started service container, defer a function which removes it.