Message218018
The second error is easy to explain and fix: it's a race condition between the OS thread used to call getaddrinfo() and the main thread. The method _write_to_self() in selector_events.py is hopelessly naive. It should probably become something like this:
def _write_to_self(self):
csock = self._csock
if csock is not None:
try:
self._csock.send(b'x')
except OSError:
pass
It is possible that the main thread closes csock at any time, and calling send() on a closed socket will raise OSError with errno=9 (EBADF). Fortunately this is because close() sets the fd to -1; so there is no worry about reuse of the fd.
I will investigate the first traceback next. |
|
Date |
User |
Action |
Args |
2014-05-06 20:53:53 | gvanrossum | set | recipients:
+ gvanrossum, pitrou, vstinner, giampaolo.rodola, yselivanov, ryder.lewis |
2014-05-06 20:53:53 | gvanrossum | set | messageid: <1399409633.14.0.593693411625.issue21447@psf.upfronthosting.co.za> |
2014-05-06 20:53:53 | gvanrossum | link | issue21447 messages |
2014-05-06 20:53:52 | gvanrossum | create | |
|