DarthSim / overmind

Process manager for Procfile-based applications and tmux
MIT License
2.78k stars 79 forks source link

How to specify start order #139

Closed polRk closed 6 months ago

polRk commented 1 year ago

Like in docker-compose i can specify

depends_on:
  {{PROCESS}}:
    condition: service_started
DarthSim commented 1 year ago

Procfile is a very simple format that doesn't support health checks. Applications that use it can't determine the readiness of processes and thus can't make processes wait for their dependencies' readiness.

gedw99 commented 1 year ago

Yeah I normally make each process that connects to another process have an exponential back off / retry.

mots good practice too . Never know what is going on under the covers so best to be pessimistic

chriscz commented 6 months ago

You could probably hack this by putting in a sleep for a few milliseconds:

web: sleep 0.5 && server start

Alternatively, there are approaches like testing if a port is open:

nc -w 0.5 ${HOSTNAME} ${PORT} < /dev/null &> /dev/null

The above uses netcat to connect to the port, waiting for 0.5 seconds at most for the connection to establish.