A service restart via the supervisor API endpoints
performs the following actions
- stop the container
- remove the container
- create the container with the same configuration as before
- start the newly created container
Because of the changes in #1926 if the supervisor gets stopped between steps 1 and 2, on restart, the service won't get restarted by the supervisor when applying the target state, and it won't be started by the engine since a stop request already took place
This might be solved by combining steps 1 and 2 by doing a remove with force: true when killing a container