svn commit: samba r7149 - in trunk/source/nsswitch: .

jmcd at samba.org jmcd at samba.org
Tue May 31 18:37:04 GMT 2005


Author: jmcd
Date: 2005-05-31 18:36:59 +0000 (Tue, 31 May 2005)
New Revision: 7149

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7149

Log:
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.

Modified:
   trunk/source/nsswitch/wb_common.c


Changeset:
Modified: trunk/source/nsswitch/wb_common.c
===================================================================
--- trunk/source/nsswitch/wb_common.c	2005-05-31 18:36:38 UTC (rev 7148)
+++ trunk/source/nsswitch/wb_common.c	2005-05-31 18:36:59 UTC (rev 7149)
@@ -588,12 +588,18 @@
 			    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;
 }
 
 /*************************************************************************



More information about the samba-cvs mailing list