[distcc] [PATCH] timeout for gethostbyname and connect

Jonas Jensen jbj at knef.dk
Sat Oct 26 19:00:08 GMT 2002


This patch lets the user set the environment variable DISTCC_TIMEOUT to
control how long distcc will wait for the dns lookup and connection.
Without this patch, distcc would wait for several minutes when a host or
a dns server was down.
I've made the patch as unintrusive as I could (it falls back to the old
behavior when DISTCC_TIMEOUT isn't set), so perhaps you want to change
it to set a default timeout that's shorter than what the system provies.
Do we really want to trust our compile jobs to a host that it takes e.g.
20 seconds to connect to?

Timing out the connect call could be done easier than this, just by
interrupting it with a SIGALRM, but that's not enough to abort
gethostbyname. This method of longjmp'ing from a signal handler is what
they use in curl, so it should be ok.

/Jonas Jensen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distcc-timeout.diff
Type: text/x-patch
Size: 3473 bytes
Desc: not available
Url : http://lists.samba.org/archive/distcc/attachments/20021026/8aff6471/distcc-timeout.bin


More information about the distcc mailing list