-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker service update with --detach=false hangs on services with 0 tasks #627
Comments
What happens when you run with Since the update doesn't fix the constraint problem then the service is never fixed, right? So I think I would expect the CLI to just hang and wait for it to be fixed. We could maybe add a timeout. |
With If the expectation is that Additionally, this means that it's not really possible to update services that are supposed to run on nodes that are not yet part of the cluster (e.g. you deploy a Windows service, but you haven't added any Windows nodes yet) unless you remember to specify |
Are you sure the update isn't applied? The entire purpose of What happens if you inspect the service while the cli is stuck in "overall progress: waiting for new tasks" ? I would expect that the update has been applied, it's just the CLI is waiting for the tasks to be in the running state. I think this is the correct behaviour. If you want to update services that you know will not be in a running state then use |
Oh sorry, yes, the update does get applied. It's just that the CLI hangs and for a user it's not clear why. |
That seems like the right behaviour. How do you think this can be improved? Could we add more details to the message "overall progress: waiting for new tasks" to make it clear? Maybe we could add a timeout and print a more helpful message when the timeout is hit? |
Well, if a service has zero tasks before the update is applied, should we really wait for the tasks to get updated? Maybe in that case the service update should just return right away, even if I don't know what the original intention of that flag was, but the way I interpreted it was "block until the update has gone through on all existing tasks." What is the use case for blocking a service update forever on a service with zero tasks? |
Yes. For example when going from 0 to 1+ replicas I would expect there to be no tasks before the update, but I would still want to wait on the new tasks to be running.
It's not just existing tasks, because the update could change the number of tasks.
Expecting a service to have 0 tasks doesn't really seem like a common use case. There's already a way of handling this rare case, which is to use |
If this is working as intended, then that's fine; my point is just that this is somewhat surprising for global services. Replicated services always have at least one |
#104) * fix: docker service update with `--detach=false` hangs on services with 0 tasks read more here: docker/cli#627 * refactor: use $(...) notation instead of legacy backticks `...` * refactor: `tasks_num` variable renamed to `num_tasks` * refactor: use `-f` for filtering service by name
Description
If you have a global service that cannot be scheduled anywhere (e.g. its placement constraints are incorrect), its task list will be empty. If you try to update that service with
--detach=false
, the CLI will hang while "waiting for new tasks."Steps to reproduce the issue:
docker service create --name testservice --mode global --constraint node.platform.os==notarealos busybox sleep 24h
docker service ps testservice
(note that the task list is empty)docker service update --detach=false --label-add foo=bar testservice
Describe the results you received:
The CLI hangs forever with
overall progress: waiting for new tasks
Describe the results you expected:
The update would go through
The client I tested this on was
17.09.0-ce
, but this is likely an issue on any CLI with the--detach=false
option.The text was updated successfully, but these errors were encountered: