You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On docker-compose and similar environment the DNS resolution of other containers/services only works when those containers actually are in status "Up", as opposed to containers not yet created or created but not yet started that will not be resolvable.
So you can't use wait4ports for a container that could have not been resolved yet and this starts to be a problem if you have a chicken-and-egg issue (eg. service A needs to resolve service B and also service B needs to resolve service A).
/ # wait4ports -s1 -t10 test=tcp://doesnotresolve:12345
doesnotresolve:12345 getaddrinfo: Invalid argument
No valid peers found in arguments!
Usage: wait4ports [-q] [-s <interval_seconds>] [-t <timeout_seconds>] [<name>=]<protocol>://<host>:<port> [...]
/ # wait4ports -s1 -t10 test=tcp://localhost:12345
Trying test (127.0.0.1:12345) ... failed.
Trying test (127.0.0.1:12345) ... failed.
wait4ports could be so much more useful if it could retry name resolution at every interval_seconds instead of simply failing at the first try. If strict backwards compatibility is desired, this could be an optional behavior to be enabled with a feature flag on the command line.
For comparison with other tools: wait4x and wait-for-it both work as described (they retry name resolution at every iteration).
The text was updated successfully, but these errors were encountered:
On docker-compose and similar environment the DNS resolution of other containers/services only works when those containers actually are in status "Up", as opposed to containers not yet created or created but not yet started that will not be resolvable.
So you can't use
wait4ports
for a container that could have not been resolved yet and this starts to be a problem if you have a chicken-and-egg issue (eg. service A needs to resolve service B and also service B needs to resolve service A).wait4ports
could be so much more useful if it could retry name resolution at everyinterval_seconds
instead of simply failing at the first try. If strict backwards compatibility is desired, this could be an optional behavior to be enabled with a feature flag on the command line.For comparison with other tools:
wait4x
andwait-for-it
both work as described (they retry name resolution at every iteration).The text was updated successfully, but these errors were encountered: