Package: gunicorn
Version: 20.1.0-1
Severity: important

Hello,

thank you for maintaining gunicorn!

Upstream alread has an issue about this at
https://github.com/benoitc/gunicorn/issues/2630

The problem boils down to
/usr/lib/python3/dist-packages/gunicorn/workers/gtornado.py:109
where on Tornado >= 6, the tornado application is always wrapped into a
WSGIContainer, even if it is already an instance of
tornado.web.Application. This is quite obviously not what the check
intends to do:

        if tornado.version_info[0] < 6:
            if not isinstance(app, tornado.web.Application) or \
            isinstance(app, tornado.wsgi.WSGIApplication):
                app = WSGIContainer(app)
        elif not isinstance(app, WSGIContainer):
            app = WSGIContainer(app)

A workaround for the time being until the fix makes it from upstream to
bullseye, is to:

1. make a local copy of 
/usr/lib/python3/dist-packages/gunicorn/workers/gtornado.py
   as, say, fixed_gtornado.py
2. apply this change to it: 
https://github.com/duanhongyi/gunicorn/commit/c7eacb74ebbb2461743e9706d57c2733e23fa6fd
3. run gunicorn using the runner in that fixed module:
   gunicorn --worker-class=fixed_gtornado.TornadoWorker


Enrico

-- System Information:
Debian Release: 11.1
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gunicorn depends on:
ii  python3           3.9.2-3
ii  python3-gunicorn  20.1.0-1

gunicorn recommends no packages.

Versions of packages gunicorn suggests:
pn  python3-pastedeploy   <none>
ii  python3-setproctitle  1.2.1-1+b1
ii  python3-tornado       6.1.0-1+b1

-- no debconf information

Reply via email to