Roberto De Ioris <roberto@...> writes:
> Can you post your full uWSGI config ? I have seen this kind of setup
> only with simple master+preforking mode. Maybe some other option could
> break this.

Two setups, both of which exhibit this hang after invoking Django application
on init.

Setup 2 (where these last gdb experiments were made) is on my Mac:

uwsgi --ini uwsgidev.ini -H /Users/gthb/pyenv/DM

where uwsgidev.ini contains:

[uwsgi]
master=true
processes=1
module=dmwsgi
pythonpath=datamarket:.
socket=sock/uwsgi.sock
env=dummy_proxy=dummy

That virtualenv is of Python 2.5.6 installed from MacPorts on Lion; uwsgi was
built from head of git master, adding debug=true.

Setup 1 (where my initial Django pre-warming attempt was made) is Debian:

export UWSGI_VASSAL_VIRTUALENV=/var/www-test/pythonenv
export UWSGI_VASSAL_CHDIR=/var/www-test/repo/elam/src
uwsgi --emperor /var/www-test/repo/elam/src/vassals

and vassals directory contains test.ini:

[uwsgi]
master=true
socket=:3003
harakiri=180
post-buffering=65536
processes=3
max-requests=10000
reload-on-rss=110
module=dmwsgi
buffer-size=16384
pythonpath=datamarket:.

Tried with uwsgi 0.9.9.2 from pypi and then 1.0-rc6 from tarball, in
a virtualenv of Debian's Python 2.5.2. I didn't try gdb in this setup.

Contents of dmwsgi.py are:

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

import os
if os.environ['PREWARM']:
    try:
        import cStringIO
        input = cStringIO.StringIO()
        errors = cStringIO.StringIO()
        print 'TESTING: calling application'
        def noop(status, hh, exc_info=None):
            pass
        application(
{
  'CONTENT_LENGTH': '',
  'CONTENT_TYPE': '',
  'DOCUMENT_ROOT': '/usr/local/nginx/html',
  'HTTP_HOST': 'test.datamarket.com',
  'PATH_INFO': '/__ping__',
  'REMOTE_ADDR': '157.157.92.142',
  'REMOTE_PORT': '65420',
  'REQUEST_METHOD': 'GET',
  'REQUEST_URI': '/__ping__',
  'SERVER_NAME': 'test.datamarket.com',
  'SERVER_PORT': '80',
  'SERVER_PROTOCOL': 'HTTP/1.1',
  'uwsgi.node': 'itchy',
  'uwsgi.version': '1.0-dev',
  'wsgi.multiprocess': True,
  'wsgi.multithread': False,
  'wsgi.run_once': False,
  'wsgi.url_scheme': 'http',
  'wsgi.version': (1, 0),
  'wsgi.input': input,
  'wsgi.errors': errors,
},
            noop)
    except:
        print 'TESTING: got exception'
        import traceback
        traceback.print_exc()
    else:
        print 'TESTING: survived application call'
    finally:
        print 'TESTING: reached finally clause'
        import traceback
        traceback.print_exc()

Regards,

- Gulli

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to