Skip to content
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

Use nc command if it exists and specify explicit connection timeout to avoid hanging #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vpriscan
Copy link

@vpriscan vpriscan commented May 17, 2021

Use nc command if it exists.

Add explicit connection timeout of 10 seconds, because, depending on the system, nc command could be a symlink to netcat or Ncat program (a netcat re-implementation), and Ncat has a default connection timeout od 10 seconds (thus this value was chosen), while netcat has infinite connection timeout by default. Infinite connection timeout resulted in wait-for-it.sh to hang and never succeed to connect to target host if it wasn't reachable initially but became reachable a bit later (for example when starting docker containers), until main wait-for-it.sh timeout expired, at which point it is too late.

The same timeout value of 10 seconds is also added to network redirection for the same reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant