docker service scale --detach=false does not wait for tasks to quit when scaling down
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Description
docker service scale --detach=false does not wait for tasks to quit when scaling down, but instead instantly proceeds to the verify stage. When the command quits, the tasks to be stopped may still be running when they take some time to shut down.
Steps to reproduce the issue:
docker service create --name test debian sh -c "while true; do sleep 15; done"docker service scale --detach=false test=0
Describe the results you received:
Command immediately prints overall progress: 0 out of 0 tasks and proceeds to verify stage, even if the service container is still running. The container sometimes still runs when the command quits.
Describe the results you expected:
The command blocks until the container is stopped.
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version:
Client:
Version: 17.09.0-ce
API version: 1.32
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:41:23 2017
OS/Arch: linux/amd64
Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:42:49 2017
OS/Arch: linux/amd64
Experimental: false
Output of docker info:
Additional environment details (AWS, VirtualBox, physical, etc.):
RHEL 7.4 on physical server
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 tracing the docker service scale --detach=false command through its scaling and verify stages, then reproduce the issue with the provided debian service and scale it to zero. Done means the command waits until the stopped container has actually quit before completing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100