Since we support synchronous service create and update (moby/moby#31144), it would be worthwhile to think about synchronous service removals.
One of the reasons for this is the following: Currently the service object is deleted right away, while tasks are set to desired state REMOVE, and eventually removed when the containers are stopped. During the period when shutdown is happening, it is impossible to inspect these tasks because the service object doesn't exist, which makes for bad UX and issues that are extremely difficult for the user to debug.
There are two ways to do this:
- (easy way): Keep the service object around when a service delete event comes in. The task reaper then while removing tasks with desired state
REMOVE and actual state >=SHUTDOWN also ensures that once all tasks are gone, the service object is removed.
- (harder way): End to end API change, so
docker service rm would actually wait for the removals to go through completely (with a possible --detached mode). This would require the above change, and more.
Either way, let's discuss whether this makes sense and what the right approach is.
cc @anshulpundir @dperny @tiborvass @stevvooe @aluzzardi @thaJeztah @marcusmartins
Since we support synchronous service create and update (moby/moby#31144), it would be worthwhile to think about synchronous service removals.
One of the reasons for this is the following: Currently the service object is deleted right away, while tasks are set to desired state
REMOVE, and eventually removed when the containers are stopped. During the period when shutdown is happening, it is impossible to inspect these tasks because the service object doesn't exist, which makes for bad UX and issues that are extremely difficult for the user to debug.There are two ways to do this:
REMOVEand actual state>=SHUTDOWNalso ensures that once all tasks are gone, the service object is removed.docker service rmwould actually wait for the removals to go through completely (with a possible--detachedmode). This would require the above change, and more.Either way, let's discuss whether this makes sense and what the right approach is.
cc @anshulpundir @dperny @tiborvass @stevvooe @aluzzardi @thaJeztah @marcusmartins