hazelcast-jet
hazelcast-jet copied to clipboard
Do proper cleanup in Docker-based tests
Do proper resource cleanup in Docker-based tests.
Docker volumes and exited containers are not removed after the tests and they consume system resources.
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0efa39e27b27 debezium/example-mysql:1.2 "docker-entrypoint.s…" 2 hours ago Exited (0) 2 hours ago affectionate_ritchie
a3fefde5c41b debezium/example-mysql:1.2 "docker-entrypoint.s…" 2 hours ago Exited (0) 2 hours ago nifty_golick
0f6c9e9ea4ca debezium/example-mysql:1.2 "docker-entrypoint.s…" 2 hours ago Exited (0) 2 hours ago sleepy_franklin
1246b3187cd8 debezium/example-mysql:1.2 "docker-entrypoint.s…" 2 hours ago Exited (137) 2 hours ago hopeful_jackson
259841aef88c debezium/example-mysql:1.2 "docker-entrypoint.s…" 2 hours ago Exited (0) 2 hours ago clever_varahamihira
c6b25248a8b4 debezium/example-mysql:1.2 "docker-entrypoint.s…" 2 hours ago Exited (0) 2 hours ago epic_spence
e801b2344e00 debezium/example-mysql:1.2 "docker-entrypoint.s…" 3 hours ago Exited (0) 3 hours ago determined_mccarthy
f011ebea7db1 debezium/example-mysql:1.2 "docker-entrypoint.s…" 3 hours ago Exited (0) 3 hours ago amazing_newton
2a49a2b85b38 debezium/example-mysql:1.2 "docker-entrypoint.s…" 3 hours ago Exited (0) 3 hours ago romantic_torvalds
1d7dc98e4dc5 debezium/example-mysql:1.2 "docker-entrypoint.s…" 3 hours ago Exited (137) 3 hours ago elegant_lumiere
a75794a5bf8e debezium/example-mysql:1.2 "docker-entrypoint.s…" 3 hours ago Exited (0) 3 hours ago gracious_johnson
Should this have been fixed with #2590?
I've submitted a PR (#2597) which should shed some light on the situation. It should answer two questions:
- what tests are instantiating the containers that don't get cleaned up?
- are these containers being started by code that has the previous fix (#2590) or not?
Let's see if this helps identifying the problem.
One other investigation track I have is that the listing from the issue description shows some "137" container statuses, which mean out of memory in Docker, which might explain some containers getting stuck, but I'm kind of unable to confirm anything on that path...
I will be actively monitoring the Jenkins machine and doing manual clean-up, until I can figure out the problem.
Not seeing stuck containers since two days now. Maybe the leftovers were from runs which didn't have the fixed code yet... Will keep monitoring it.