1

Let's look at following command:
docker service update --detach=true --force service_name

Let's consider log of this operation:

service_name
overall progress: 1 out of 1 tasks 
1/1: running   [==================================================>] 
verify: Waiting 1 seconds to verify that tasks are stable... 

And now, my question is: From what swarm know that task is stable and ready for running? After all, we can launch any service in swarm and the question is how it recognize that it is ok to say that update succeeded and service is ready for working. Any materials or references about these things?

Developer
  • 23
  • 3
  • Look here: https://docs.docker.com/engine/reference/builder/#healthcheck – Lev Kuznetsov Sep 10 '18 at 16:44
  • Could you be more precisely? – Developer Sep 10 '18 at 17:20
  • if the process inside the container won't die in 5 seconds and the healtcheck is OK then it's stable. – Constantin Galbenu Sep 10 '18 at 17:25
  • How dockerd is able to check if process is living? I know that it is possible in UNIX systems when parent check liveness of its child. However we have no child-parent relation here. – Developer Sep 10 '18 at 18:06
  • docker has its ID because it is starting it. – Constantin Galbenu Sep 10 '18 at 18:12
  • Do you mean ID of process in system? (We know that service is container, container is process) ? Then, given PID, are we able to recognize if process is living or not? It seems to be natually, for example with (h)top tool. Yeah? In other words I don't understand: `docker has its ID because it is starting it` What is ID exactly? After all, each (not only starter) can know PIDs of processes. – Developer Sep 10 '18 at 21:25
  • @Developer If you perform `docker inspect `, you will see that Docker knows the PID of the container process (under State). It also has it's Status. – far Sep 11 '18 at 18:20

1 Answers1

0

for Docker, "tasks are stable" is the opposite to "overall progress: 0 out of 1 tasks". Remember that, for a container is UP, you need run a process/task (al least one). this is the reason why docker need verify if one task are running Ok.

Regards

Chuss
  • 142
  • 1
  • 3