Package: gunicorn3
Version: 19.6.0-10+deb9u1
Severity: normal

Dear Maintainer,

I'm writing a web application that needs to server fairly large files,
in the terabyte range. I am using python3-bottle for my code, and it
works just fine. However, when I run my application with gunicorn3 it
doesn't work.

I've distilled this into a small test case. The application code,
saved as file foo.py:

    import bottle

    def blob(*args, **kwargs):
        return bottle.static_file('blob', '.')

    app = bottle.Bottle()
    app.route(path='/blob', callback=blob)

This is the script that starts it, saved as file start.sh:

    #!/bin/sh

    set -eu

    truncate -s 1G blob
    gunicorn3 --bind 0.0.0.0:12765 foo:app

To test, run "sh +x start.sh", and then from another host run:

    curl http://195.201.99.89:12765/blob > blob

This always fails for me: curl complains:

     curl: (18) transfer closed with 611469105 bytes remaining to read

It seems to always work over localhost. It always works when the blob
is sufficiently small, such as 1024 bytes, even between hosts.

If I don't use gunicorn, and use the Bottle built-in HTTP server, it
always works. Like this:

    import bottle

    def blob(*args, **kwargs):
        return bottle.static_file('blob', '.')

    app = bottle.Bottle()
    app.route(path='/blob', callback=blob)

    if __name__ == '__main__':
        app.run(host='0.0.0.0', port=12765)

I ran that on one machine, and ran curl on a different host and it
worked 10 times in a row.

-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gunicorn3 depends on:
ii  python3           3.5.3-1
ii  python3-gunicorn  19.6.0-10+deb9u1

gunicorn3 recommends no packages.

Versions of packages gunicorn3 suggests:
pn  gunicorn-examples     <none>
pn  python3-pastedeploy   <none>
pn  python3-setproctitle  <none>
pn  python3-tornado       <none>

-- no debconf information

Reply via email to