[Patches] [ python-Patches-1763387 ] socket close fixed
SourceForge.net
noreply at sourceforge.net
Mon Jul 30 12:06:39 CEST 2007
Patches item #1763387, was opened at 2007-07-30 02:38
Message generated for change (Comment added) made by kuran
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1763387&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Hasan Diwan (hdiwan650)
Assigned to: Nobody/Anonymous (nobody)
Summary: socket close fixed
Initial Comment:
Patch fixes the race condition causing tests to mysteriously fail.
----------------------------------------------------------------------
Comment By: Jp Calderone (kuran)
Date: 2007-07-30 06:06
Message:
Logged In: YES
user_id=366566
Originator: NO
SO_REUSEADDR is a flag. It's not a period of time measured in seconds.
So using it with time.sleep() is conceptually broken, even though it
happens to do something without raising an exception.
And socket.close() really, really, really should not sleep for any length
of time at all. It does what it needs to do by making the low-level call,
and then it can return. If the port shouldn't be re-used for some period
of time, that is up to the application using the socket to deal with.
Since this ticket doesn't actually explain what the test failures _are_, I
can't really suggest an alternate solution. I assume it is something to do
with binding to ports failing, though. In this case, the tests should just
be changed to bind port 0, which will force the platform to select an
unused port.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1763387&group_id=5470
More information about the Patches
mailing list