"Stop" should be symmetrical to "Start"
On "start", Roboconf waits that all dependencies are started before to start a component. So a component is started after all its dependencies. On "stop", Roboconf stops the component, next its dependencies are stopped.
This process can generate errors because the component is stopped before its dependencies. These errors can be avoided stopping the component after its dependency, symmetrically to the process "start".
Example: My component Petals SE Activiti requires the component "Database Activiti". When I stop "Database Activiti", I can get errors on Petals SE Activiti that processes requests. The Petals SE Activiti should be stopped before the database.
I have thought about it. And IMO, the stop command should not change. It does not mean we cannot address this use case, but it will not be by replacing the stop command. All the instructions given to an agent (through the web console) are handled by a single agent. The decision is local. The DM does nothing except transmitting the request to the right agent. The agent decides what to do based on what it knows (local deployments) and the insutrctions it received. It hardly knows nothing about other agents. Extending what the agent knows to have a global awareness would be toooooooooooooo complex.
Stopping dependencies before stopping an instance is not a local decision. It is a global, complex and long-running process. And the most simple solution to support it is to upgrade the DM. I think we could have a new Roboconf command to handle this use case. See #515 and this page.
After all, not all the components need such a stop process. We need to think about it...