Bug#997990: tornado worker does not work with Tornado 6

2021-10-31 Thread Enrico Zini
On Thu, Oct 28, 2021 at 05:21:05PM -, Chris Lamb wrote:

> Thanks for filing #997990 and #997992 for issues in gunicorn. As it
> happens, though, I am no longer using the Debian package of gunicorn
> and, as such, I wonder if it makes more sense for someone else to take
> over maintainership. At the very least, this will ensure that fixes
> for these two issues can reliably tested.
> 
> Would this new maintainer be, perhaps, you? :)

Thank you for the offer. I'm afraid I can't pick it up, as I'm heavily
struggling to look after my own packages as it is.

I concluded that #997992 is not fixable, and I"m redesigning our
tornado-related architecture to move away from gunicorn and towards
something like https://unrouted.io/ops/2017/04/26/multicore-twistd-with-systemd/

As I'm moving away from using gunicorn to run tornado, it's quite
unlikely I'll also be able to test a fix for #997990 besides rerunning
the test cases I attached to the upstream bug.


Enrico

-- 
GPG key: 4096R/634F4BD1E7AD5568 2009-05-08 Enrico Zini 



Bug#997990: tornado worker does not work with Tornado 6

2021-10-28 Thread Chris Lamb
Hi Enrico,

> thank you for maintaining gunicorn!

Thanks for filing #997990 and #997992 for issues in gunicorn. As it
happens, though, I am no longer using the Debian package of gunicorn
and, as such, I wonder if it makes more sense for someone else to take
over maintainership. At the very least, this will ensure that fixes
for these two issues can reliably tested.

Would this new maintainer be, perhaps, you? :)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org  chris-lamb.co.uk
   `-



Bug#997990: tornado worker does not work with Tornado 6

2021-10-28 Thread Enrico Zini
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   
ii  python3-setproctitle  1.2.1-1+b1
ii  python3-tornado   6.1.0-1+b1

-- no debconf information