This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年12月03日 10:17 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| find_unused_race.diff | neologix, 2014年07月24日 18:46 | review | ||
| Messages (11) | |||
|---|---|---|---|
| msg205099 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年12月03日 10:17 | |
It's on the FreeBSD 10.0 buildbot: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/1169 ====================================================================== ERROR: test_getsockaddrarg (test.test_socket.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_socket.py", line 1159, in test_getsockaddrarg sock.bind((host, port)) OSError: [Errno 48] Address already in use |
|||
| msg205131 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2013年12月03日 18:09 | |
This test is inherently subject to a race condition: """ port = support.find_unused_port() [...] try: self.assertRaises(OverflowError, sock.bind, (host, big_port)) self.assertRaises(OverflowError, sock.bind, (host, neg_port)) sock.bind((host, port)) finally: sock.close() """ The buildbot being set up ton run the test suite with "-j4" is probably the most important factor. A possibility would be to try the find_unused_port() + bind() in a loop a couple times. |
|||
| msg205227 - (view) | Author: John W. O'Brien (neirbowj) | Date: 2013年12月04日 15:25 | |
For reference: CPython code comments showing that this may be an anticipated problem: http://hg.python.org/cpython/file/0830670a9d9d/Lib/test/support/__init__.py#l562 An example of another project that seems to have tackled this problem in the way neologix suggests: http://openvswitch.org/pipermail/dev/2013-April/026430.html I am inclined to frame this issue as a choice between LBYL (try to predict, subject to the race, whether a port will be available) and EAFP (blindly try a few random high ports before inferring failure). |
|||
| msg223818 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年07月24日 08:28 | |
Clearly the long term solution is to fix the problems in the cpython code referenced in msg205227, but in the short term is it worth attempting a work around as suggested in msg205131 ? |
|||
| msg223868 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2014年07月24日 18:46 | |
Here's a patch. |
|||
| msg223980 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年07月25日 17:45 | |
New changeset 897c9e6ddb1a by Charles-François Natali in branch '3.4': Issue #19875: Fix random test_getsockaddrarg() failure. http://hg.python.org/cpython/rev/897c9e6ddb1a New changeset 619feea86ce4 by Charles-François Natali in branch 'default': Issue #19875: Fix random test_getsockaddrarg() failure. http://hg.python.org/cpython/rev/619feea86ce4 |
|||
| msg223981 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2014年07月25日 17:54 | |
Should be fixed now, thanks! |
|||
| msg224048 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2014年07月26日 12:27 | |
Thank you for taking care of this Charles-François :) Requesting backport to 3.3 and 2.7 too please, both are open for fixes. |
|||
| msg224051 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年07月26日 12:45 | |
New changeset 57e3c4ae37ea by Charles-François Natali in branch '2.7': Issue #19875: Fix random test_getsockaddrarg() failure. http://hg.python.org/cpython/rev/57e3c4ae37ea |
|||
| msg224052 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2014年07月26日 12:46 | |
Backported to 2.7 (don't know how Iforgot it). 3.3 is only open for security issues, so not backporting. |
|||
| msg224055 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2014年07月26日 13:12 | |
Updating versions to reflect branch changes. Will come in handy for those tracking for manual packaging backports |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:54 | admin | set | github: 64074 |
| 2014年07月26日 13:12:02 | koobs | set | messages:
+ msg224055 versions: + Python 2.7, Python 3.5, - Python 3.3 |
| 2014年07月26日 12:46:33 | neologix | set | messages: + msg224052 |
| 2014年07月26日 12:45:37 | python-dev | set | messages: + msg224051 |
| 2014年07月26日 12:27:47 | koobs | set | messages: + msg224048 |
| 2014年07月25日 17:54:33 | neologix | set | status: open -> closed resolution: fixed messages: + msg223981 stage: resolved |
| 2014年07月25日 17:45:59 | python-dev | set | nosy:
+ python-dev messages: + msg223980 |
| 2014年07月24日 18:46:25 | neologix | set | files:
+ find_unused_race.diff keywords: + patch messages: + msg223868 |
| 2014年07月24日 08:28:48 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg223818 |
| 2013年12月04日 15:25:12 | neirbowj | set | nosy:
+ neirbowj messages: + msg205227 |
| 2013年12月03日 18:09:55 | neologix | set | messages: + msg205131 |
| 2013年12月03日 10:17:39 | pitrou | create | |