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.

Author gvanrossum
Recipients giampaolo.rodola, gvanrossum, pitrou, ryder.lewis, vstinner, yselivanov
Date 2014-05-06.20:53:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399409633.14.0.593693411625.issue21447@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-05-06 20:53:53gvanrossumsetrecipients: + gvanrossum, pitrou, vstinner, giampaolo.rodola, yselivanov, ryder.lewis
2014-05-06 20:53:53gvanrossumsetmessageid: <1399409633.14.0.593693411625.issue21447@psf.upfronthosting.co.za>
2014-05-06 20:53:53gvanrossumlinkissue21447 messages
2014-05-06 20:53:52gvanrossumcreate