benoitc/gunicorn — pull request #709 by pdodde (2014-02-25 23:16:14+00:00)
Title: Raise new exception to avoid race condition on socket.error

We have been seeing issue 514 occasionally. https://github.com/benoitc/gunicorn/issues/514

Best guess is that we are getting real socket errors but the message gets overwritten by the next call to connect before it is read by the web app. This fix creates a new Exception with the socket error before the loop continues and the error can be over written.