[prev in list] [next in list] [prev in thread] [next in thread] 

List:       system-config-printer-devel
Subject:    pysmbc does not close connections
From:       twaugh () redhat ! com (Tim Waugh)
Date:       2011-05-18 12:31:00
Message-ID: 1305721863.2189.3.camel () worm ! elk
[Download RAW message or body]

On Sat, 2011-04-23 at 10:54 +0200, Moritz Schlarb wrote:
> We're using pysmbc in a project where we have a file crawler that crawls 
> some hundreds of samba servers.
> 
> I recently noticed, that when this crawler runs (with a worker pool of 
> 10 processes), it - of course - opens lots of connections to the servers 
> it is supposed to crawl but doesn't close them afterwards!
> So the established connections cumulate when I watch it with netstat -t 
> on the crawling machine.
> 
> This behaviour stays the same, when I say
> c = smbc.Context()
> #crawl
> del c

I can't reproduce this.  Using this small test program, I let it run for
a minute or so and then examined its open file descriptors: there were
none, other than stdin/stdout/stderr.

#!/usr/bin/python
import smbc
while True:
	c = smbc.Context ()
	del c

$ ls -l /proc/26855/fd
total 0
lrwx------. 1 twaugh twaugh 64 May 18 13:27 0 -> /dev/pts/0
lrwx------. 1 twaugh twaugh 64 May 18 13:27 1 -> /dev/pts/0
lrwx------. 1 twaugh twaugh 64 May 18 13:26 2 -> /dev/pts/0

In other words, no sockets are opened simply for creating a context.

It's entirely possible there is a leak somewhere in pysmbc, but I can't
spot it.

Perhaps you could watch the network traffic using a tool such as
wireshark, and see which connections are left open and what they were
for.

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : https://fedorahosted.org/pipermail/system-config-printer-devel/attachments/20110518/3ba945eb/attachment.bin \



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic