Synchronous service removal
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.7k
- Forks
- 676
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 6
Description
Since we support synchronous service create and update (https://github.com/moby/moby/pull/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
REMOVEand actual state>=SHUTDOWNalso ensures that once all tasks are gone, the service object is removed. - (harder way): End to end API change, so
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked synchronous service create/update change and the service deletion flow described here, including the task reaper and docker service rm. Determine whether retaining the service until all REMOVE tasks are gone is sufficient or whether an end-to-end synchronous API change is needed. Done means an agreed approach with defined removal and inspection behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100