[Python-Dev] socket.fromfd() documentation problem

Kálmán Gergely kalman.gergely at duodecad.hu
Wed Oct 6 09:34:05 CEST 2010


I was having a very nasty fd leak recently where I've leaked more than 200k
FDs, allocating more than 1Gbytes of ram in kernel space. It was my 
fault alright,
but I thought I'd mention it here so maybe you'll put a little NOTE 
section in the
documentation mentioning that you have to os.close() the original FD to 
leakage. Also I'm not completely clear why python does it this way and 
why not
close the original socket - it seems (at least to me) that this would be 
the right(er)

Nevertheless what are your thoughts on this? Should I file a bug report 
for it?

(The best part was that the allocated FD memory did not show up as slab, so
this was a real pain in the butt to hunt down)

Kalman Gergely

More information about the Python-Dev mailing list