benoitc/gunicorn — Issue #289: name resolution failures under gevent
Author: clearclaw
Created: 2011-12-22 00:40:57+00:00
State: open

$ python26 -c "from gevent.core import *; print get_method(), get_version()"
epoll 1.4.13-stable

$ rpm -qa | fgrep gevent
python-gevent-1.0a3-95699

$ python26 -c "import gevent; from gevent import socket; from gevent.dns import resolve_ipv4; print socket.gethostbyname ('google.com'); print resolve_ipv4; resolve_ipv4 ('google.com')"
74.125.224.240

Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python2.6/site-packages/gevent/dns.py", line 59, in resolve_ipv4
raise DNSError(result)
gevent.dns.DNSError: [Errno 3] name does not exist

More simply under Gunicorn this manifests in a WSGI method which attempts to make an outbound HTTP call using urrlib2. here follows a stack trace of the fault:

ssagent[15076].print_exc_plus(261): CRITICAL Traceback (most recent call last):
File "/ysi/apps/a-agent/aagent_upload.py", line 254, in POST
conf["POSTBACK_RETRIES"])
File "/ysi/apps/a-agent/aagent_upload.py", line 125, in do_callbacks
s)
File "/usr/lib/python2.6/site-packages/ssagent.py", line 123, in encrypt_token
tree = s.do ()
File "/usr/lib/python2.6/site-packages/ssagent.py", line 72, in do
rc = urllib2.urlopen (req)
File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib64/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
File "/usr/lib64/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib64/python2.6/urllib2.py", line 1161, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib64/python2.6/urllib2.py", line 1136, in do_open
raise URLError(err)
URLError:

ssagent[15076].print_exc_plus(262): CRITICAL Locals by frame, innermost last (first 100 characters):
ssagent[15076].print_exc_plus(266): CRITICAL Frame POST in /ysi/apps/a-agent/aagent_upload.py at line 284

ssagent[15076].print_exc_plus(273): CRITICAL status =
ssagent[15076].print_exc_plus(273): CRITICAL file_target = /shared/silo/094/0ec/d5848b9e-e618-4ae8-b46b-03a5987cf26e.00000000000000000001
ssagent[15076].print_exc_plus(273): CRITICAL qs = {'id': '393183984', 'op': 'xmlupload'}
ssagent[15076].print_exc_plus(273): CRITICAL e =
ssagent[15076].print_exc_plus(273): CRITICAL ufid = d5848b9e-e618-4ae8-b46b-03a5987cf26e.00000000000000000001
ssagent[15076].print_exc_plus(273): CRITICAL max_filelen = 104857600
ssagent[15076].print_exc_plus(273): CRITICAL self =
ssagent[15076].print_exc_plus(273): CRITICAL offset = 0
ssagent[15076].print_exc_plus(273): CRITICAL file_source = /shared/silo/staging/adp-demo/d5848b9e-e618-4ae8-b46b-03a5987cf26e.00000000000000000001
ssagent[15076].print_exc_plus(273): CRITICAL disk_limit = 104857600
ssagent[15076].print_exc_plus(273): CRITICAL auth = {'ProgressId': '7e66060f-d599-4ff0-8750-8604b170355f', 'ttlBase': '1324512780799', 'ufid': 'd5848b9e
ssagent[15076].print_exc_plus(273): CRITICAL max_postlen = 104878080
ssagent[15076].print_exc_plus(273): CRITICAL forms =
ssagent[15076].print_exc_plus(273): CRITICAL start = 1324512781.62
ssagent[15076].print_exc_plus(273): CRITICAL length = 2910556
ssagent[15076].print_exc_plus(273): CRITICAL conf = {'AUTH_PATH': '/shared/working/a-agent/auth', 'BEANSTALK_HOST': '127.0.0.1', 'BEANSTALK_PORT': '1130
ssagent[15076].print_exc_plus(273): CRITICAL fg =
ssagent[15076].print_exc_plus(273): CRITICAL bufsize = 1048576
ssagent[15076].print_exc_plus(273): CRITICAL files =
ssagent[15076].print_exc_plus(273): CRITICAL stage = /shared/silo/staging/adp-demo
ssagent[15076].print_exc_plus(266): CRITICAL Frame do_callbacks in /ysi/apps/a-agent/aagent_upload.py at line 153

ssagent[15076].print_exc_plus(273): CRITICAL retries = 10
ssagent[15076].print_exc_plus(273): CRITICAL s = {"ProgressId": "7e66060f-d599-4ff0-8750-8604b170355f", "Description": "The file successfully uploade
ssagent[15076].print_exc_plus(273): CRITICAL auth = {'ProgressId': '7e66060f-d599-4ff0-8750-8604b170355f', 'ttlBase': '1324512780799', 'ufid': 'd5848b9e
ssagent[15076].print_exc_plus(273): CRITICAL filename = 1880_rules.pdf
ssagent[15076].print_exc_plus(273): CRITICAL forms =
ssagent[15076].print_exc_plus(273): CRITICAL host = https://www.yousendit.com/postback.php
ssagent[15076].print_exc_plus(273): CRITICAL t = {'ProgressId': '7e66060f-d599-4ff0-8750-8604b170355f', 'Description': 'The file successfully uploade
ssagent[15076].print_exc_plus(273): CRITICAL conf = {'AUTH_PATH': '/shared/working/a-agent/auth', 'BEANSTALK_HOST': '127.0.0.1', 'BEANSTALK_PORT': '1130
ssagent[15076].print_exc_plus(273): CRITICAL rc = None
ssagent[15076].print_exc_plus(273): CRITICAL filesize = 2909321
ssagent[15076].print_exc_plus(266): CRITICAL Frame encrypt_token in /usr/lib/python2.6/site-packages/ssagent.py at line 123

ssagent[15076].print_exc_plus(273): CRITICAL endpoint = http://sjclbirbl01.prod.yousendit.com:8090/rbl/YsiEncryption
ssagent[15076].print_exc_plus(273): CRITICAL token = {"ProgressId": "7e66060f-d599-4ff0-8750-8604b170355f", "Description": "The file successfully uploade
ssagent[15076].print_exc_plus(273): CRITICAL nsurl = {http://su2}
ssagent[15076].print_exc_plus(273): CRITICAL s =
ssagent[15076].print_exc_plus(273): CRITICAL api = encodeAESData
ssagent[15076].print_exc_plus(273): CRITICAL nsname = su2
ssagent[15076].print_exc_plus(266): CRITICAL Frame do in /usr/lib/python2.6/site-packages/ssagent.py at line 72

ssagent[15076].print_exc_plus(273): CRITICAL xml =