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 Michael.Ballantyne
Recipients Michael.Ballantyne, ronaldoussoren
Date 2013-07-14.23:24:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1373844260.31.0.599002604646.issue18455@psf.upfronthosting.co.za>
In-reply-to
Content
from multiprocessing/connection.py:
while 1:
        try:
            s.connect(address)
        except socket.error, e:
            if e.args[0] != errno.ECONNREFUSED or _check_timeout(t):
                debug('failed to connect to address %s', address)
                raise
            time.sleep(0.01)
        else:
            break
    else:
        raise


According to the POSIX spec http://pubs.opengroup.org/onlinepubs/9699919799/
"If connect() fails, the state of the socket is unspecified. Conforming applications should close the file descriptor and create a new socket before attempting to reconnect."

On Mac OS X and other BSDs (but not Linux), attempting to connect() again throws EINVAL. As a result, the multiprocessing.connection.Client does not successfully retry, and instead throws 
socket.error: [Errno 22] Invalid argument 
after the first refused connection. I found that error message pretty confusing, and didn't realize that it effectively meant the connection was refused.

The change for issue #13215 removes the retry behavior entirely, so this bug does not appear in 3.3 and up.
History
Date User Action Args
2013-07-14 23:24:20Michael.Ballantynesetrecipients: + Michael.Ballantyne, ronaldoussoren
2013-07-14 23:24:20Michael.Ballantynesetmessageid: <1373844260.31.0.599002604646.issue18455@psf.upfronthosting.co.za>
2013-07-14 23:24:20Michael.Ballantynelinkissue18455 messages
2013-07-14 23:24:19Michael.Ballantynecreate