Sometimes after terminating circus, the robot containers aren't removed.
The function sending the stop HTTP request to the Docker APIs is Container::stop() which is automatically triggered when the robot owning the docker gets destroyed in turn.
Going one step further, destroying a Team, all the components (Robots) are also destroyed.
This is the reason why the following call:
TeamManager::instance().clear()
causes an avalanche effect, destroying all the robots and the related containers.
The team cleanup is executed in two cases:
- When the
AppWindow is closed using the GUI (x at the top right corner of the window)
- When circus catches a signal.
The fact that there are some cases (that I didn't manage to reproduce consistently) where the containers remain pending means that either the 'avalanche' effect doesn't always work or that circus can also be terminated in a different way.
I'm leaning more toward the first option. The avalanche effect works thanks to the unique_ptr when the owner dies, all its childen die in turn. There might be cases in which the robots are never destroyed and so the containers are not destroyed. Idk we'll have to investigate this further.
Sometimes after terminating circus, the robot containers aren't removed.
The function sending the stop HTTP request to the Docker APIs is
Container::stop()which is automatically triggered when the robot owning the docker gets destroyed in turn.Going one step further, destroying a
Team, all the components (Robots) are also destroyed.This is the reason why the following call:
causes an avalanche effect, destroying all the robots and the related containers.
The team cleanup is executed in two cases:
AppWindowis closed using the GUI (x at the top right corner of the window)The fact that there are some cases (that I didn't manage to reproduce consistently) where the containers remain pending means that either the 'avalanche' effect doesn't always work or that circus can also be terminated in a different way.
I'm leaning more toward the first option. The avalanche effect works thanks to the
unique_ptrwhen the owner dies, all its childen die in turn. There might be cases in which the robots are never destroyed and so the containers are not destroyed. Idk we'll have to investigate this further.