summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2005-05-31 18:36:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:03 -0500
commit583b7ed6595e85e8366632dd0ab5dbfcdc1838e6 (patch)
tree18bf61f8a64f6b9a07510c350bf82119b3c3a7e9
parent9f38c321d0ebfb12be2cd6162659f8cb25fa8f5b (diff)
downloadsamba-583b7ed6595e85e8366632dd0ab5dbfcdc1838e6.tar.gz
samba-583b7ed6595e85e8366632dd0ab5dbfcdc1838e6.tar.bz2
samba-583b7ed6595e85e8366632dd0ab5dbfcdc1838e6.zip
r7148: Fix #2736: winbind race condition with detecting idle clients
winbind idle connection closing logic is getting invoked under high loads for clients which may already have commands in the pipe. This race condition causes clients to fail with NSS_STATUS_UNAVAIL sometimes. We now retry several times hoping (still not guaranteed, though) it will work. (This used to be commit 05c04cfd2526b8b9a82916b5dffc18bf27c3f198)
-rw-r--r--source3/nsswitch/wb_common.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c
index 40cf534c41..d2e8b9cc6a 100644
--- a/source3/nsswitch/wb_common.c
+++ b/source3/nsswitch/wb_common.c
@@ -588,12 +588,18 @@ NSS_STATUS winbindd_request(int req_type,
struct winbindd_request *request,
struct winbindd_response *response)
{
- NSS_STATUS status;
+ NSS_STATUS status = NSS_STATUS_UNAVAIL;
+ int count = 0;
- status = winbindd_send_request(req_type, request);
- if (status != NSS_STATUS_SUCCESS)
- return(status);
- return winbindd_get_response(response);
+ while ((status == NSS_STATUS_UNAVAIL) && (count < 10)) {
+ status = winbindd_send_request(req_type, request);
+ if (status != NSS_STATUS_SUCCESS)
+ return(status);
+ status = winbindd_get_response(response);
+ count += 1;
+ }
+
+ return status;
}
/*************************************************************************
@@ -606,7 +612,7 @@ NSS_STATUS winbindd_request(int req_type,
BOOL winbind_off( void )
{
- static char *s = CONST_DISCARD(char *, WINBINDD_DONT_ENV "=1");
+ static char *s = CONST_DISCARD(char *, WINBINDD_DONT_ENV "=1");
return putenv(s) != -1;
}