Using Apache 2.4.29, mod_wsgi 4.5.24 and Python 3.6.4.

I serve big files using WSGI and an iterator. When the client closes the
connection BEFORE the file is completed, an error 500 is logged in
Apache, without any indication of the issue or how to solve it.

I have a minimal testcase:

1. Apache configuration: Inside a virtualhost I do this:

"""
WSGIDaemonProcess test threads=16 display-name=%{GROUP}
python-path=/home/buffy/ home=/home/buffy/ stack-size=524288
WSGIApplicationGroup %{GLOBAL}
WSGIProcessGroup test
WSGIScriptAlias /test /home/buffy/z.py
<Location /test/>
 require all granted
</Location>
"""

2. The WSGI application "/home/buffy/z.py" is quite trivial:

"""
class app:
    def __init__(self, environ, start_response):
        start_response('200 OK',
                       [('content-type', 'application/octet-stream')])

    def __iter__(self):
        while True:
            yield b'W'*4096

def application(environ, start_response) :
    return app(environ, start_response)
"""

Any request inside "/test/" with wget or similar will generate an
infinitely long file. Just do a random request with "wget", let it go
for a couple of seconds (the file size if unbounded, beware) and abort
"wget" with control+c.

What I get: An error 500 in my Apache virtualhost access log. Nothing in
the error log.

What I would like to get: a 200 in my Apache virtualhost access log.

What am I doing wrong?. A "def close(self): pass" doesn't change
anything. Suggestions?.

-- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
[email protected] - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:[email protected]  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to