[Patches] [ python-Patches-1093468 ] socket leak in SocketServer

SourceForge.net noreply at sourceforge.net
Sun Jan 16 16:55:20 CET 2005


Patches item #1093468, was opened at 2004-12-30 21:57
Message generated for change (Comment added) made by irmen
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1093468&group_id=5470

Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Shannon -jj Behrens (jjinux)
Assigned to: Nobody/Anonymous (nobody)
Summary: socket leak in SocketServer

Initial Comment:
Found in Python 2.3.4 but still present in 2.5.
FreeBSD 4.9

Summary:
Fixed a socket leak in
SocketServer.StreamRequestHandler that happens during
certain exceptions.

Longer version:
SocketServer.StreamRequestHandler.setup sets up
self.rfile and self.wfile.  The parent class,
SocketServer.BaseRequestHandler.__init__ does not call
self.finish() if there is an exception thrown in
self.handle().  Hence, such an exception leads to a
leaked socket, because
SocketServer.StreamRequestHandler.finish never gets
called.  This is a one line patch that fixes that.

----------------------------------------------------------------------

Comment By: Irmen de Jong (irmen)
Date: 2005-01-16 16:55

Message:
Logged In: YES 
user_id=129426

Looks harmless enough but aren't the sockets just garbage
collected once the request has been handled?
Because the request handler class is instantiated for each
request and so it will be removed once done, taking the
sockets with it, right?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1093468&group_id=5470


More information about the Patches mailing list