svn commit: samba r18583 - in branches/SAMBA_4_0/source/smb_server/smb: .

tridge at samba.org tridge at samba.org
Sat Sep 16 16:27:46 GMT 2006


Author: tridge
Date: 2006-09-16 16:27:46 +0000 (Sat, 16 Sep 2006)
New Revision: 18583

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

Log:

a nasty hack to allow me to monitor the number of open file
descriptors in smbd on all build farm machines. I suspect we have a fd
leak somewhere, but its hard to track down. 

I know part of the problem is the number of (fake) network interfaces
we define in the build farm tests, with each of them listening on a
whole bunch of different protocol ports. That chews up around 48 file
descriptors just to startup. I don't think thats the real problem
though, and I suspect something else is leaking file descriptors on
some hosts.

Modified:
   branches/SAMBA_4_0/source/smb_server/smb/receive.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/receive.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb/receive.c	2006-09-16 15:51:41 UTC (rev 18582)
+++ branches/SAMBA_4_0/source/smb_server/smb/receive.c	2006-09-16 16:27:46 UTC (rev 18583)
@@ -26,6 +26,7 @@
 #include "smb_server/smb_server.h"
 #include "smb_server/service_smb_proto.h"
 #include "ntvfs/ntvfs.h"
+#include "system/filesys.h"
 
 
 /*
@@ -77,6 +78,18 @@
 
 	smb_conn->statistics.last_request_time = cur_time;
 
+	/* a temporary hack to allow me to find a possible file descriptor leak in 
+	   build farm machines (tridge) */
+	{
+		static int maxfd;
+		int xfd = open("/dev/null", O_RDONLY);
+		close(xfd);
+		if (xfd > maxfd) {
+			maxfd = xfd;
+			DEBUG(0,("MAXFD=%d\n", maxfd));
+		}
+	}
+
 	/* see if its a special NBT packet */
 	if (CVAL(blob.data, 0) != 0) {
 		req = smbsrv_init_request(smb_conn);



More information about the samba-cvs mailing list