diff options
author | simon <simon@FreeBSD.org> | 2007-03-04 10:30:43 +0000 |
---|---|---|
committer | simon <simon@FreeBSD.org> | 2007-03-04 10:30:43 +0000 |
commit | 38eadf93ffb5ad4ea95274a0d1eef609471c4d7d (patch) | |
tree | 94f4952551f8f72bd14789cb16b83b54b44503c5 /lib/libc/yp/yplib.c | |
parent | 66581633ca91e950e76a9f11dcd8b80c57769d9b (diff) | |
download | FreeBSD-src-38eadf93ffb5ad4ea95274a0d1eef609471c4d7d.zip FreeBSD-src-38eadf93ffb5ad4ea95274a0d1eef609471c4d7d.tar.gz |
- Bump _yplib_timeout limit from 10 to 20 seconds to better handle
packet loss when talking to a NIS server.
- Set 1 second retry timeout to further realistically handle UDP
packet loss for yp_next packet bursts. If the packet hasn't come
back within 1 second its rather unlikely to come back at all. There
is still back-off mechanism in RPC so if there is another reason
than packet loss for the lack of response within 1 second, the NIS
server will not be totally bombarded with requests.
This reduces the risk of NIS failing with:
yp_next: clnt_call: RPC: Timed out
considerably. This is mainly a problem if you have larger NIS maps
(like at FreeBSD.org) since enumerations of the lists will cause a UDP
packet bursts where a few packets being lost once in a while do
happen.
MFC after: 1 week
Discussed with: peter
Problem mainly diagnosed by: peter
Diffstat (limited to 'lib/libc/yp/yplib.c')
-rw-r--r-- | lib/libc/yp/yplib.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 74a791e..cc0a511 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -103,7 +103,7 @@ void *ypresp_data; static void _yp_unbind(struct dom_binding *); struct dom_binding *_ypbindlist; static char _yp_domain[MAXHOSTNAMELEN]; -int _yplib_timeout = 10; +int _yplib_timeout = 20; static mutex_t _ypmutex = MUTEX_INITIALIZER; #define YPLOCK() mutex_lock(&_ypmutex); @@ -823,6 +823,14 @@ again: return (YPERR_DOMAIN); } + /* + * Set low retry timeout to realistically handle UDP packet + * loss for yp_next packet bursts. + */ + tv.tv_sec = 1; + tv.tv_usec = 0; + clnt_control(ysd->dom_client, CLSET_RETRY_TIMEOUT, (char*)&tv); + tv.tv_sec = _yplib_timeout; tv.tv_usec = 0; |