Basically, the messages describe break of the WSGI protocol by wsgi
application - it must call start_response and do it exactly once. Are
you sure that this is always the case?
If yes, then can you try the other wsgi server (gevent.pywsgi) and see
if the error persists or disappears?
I don't think that sockets and monkey patching has anything to do with
this - it seems that this is the consequence of the logic error in
your WSGI app.
As usual, minimal example that reproduces the error would help. If
that's not possible post your application function here.
Cheers,
Denis.
That wouldn't explain why the problem exists both in gevent.wsgi and
gevent.pywsgi. The former does not use Python sockets at all.
Maybe you could add this line:
import traceback; traceback.print_stack() to the beginning of
start_response() in gevent/wsgi.py?
this would help tracing the situation when start_response is called twice.
Just in case, please try this with the latest tip:
http://bitbucket.org/denis/gevent
I see.
I don't know what causes "Broken Pipe" but even in case of the error like that
your application should not call start_response() again. The better
strategy is don't
do anything at all and let the error propagate. If the error is not
caught by the app or by
the middleware then the server will generate 500 error.
>
>> Just in case, please try this with the latest tip:http://bitbucket.org/denis/gevent
>
> I'm statically building at the moment, direct from the tip I believe.
> Here's how I'm doing it:
>
> git clone http://github.com/schmir/gevent.git
> cd gevent
> git checkout origin/wip-all
This is not the same as http://bitbucket.org/denis/gevent
> python setup.py build_libevent build install
>
> If I don't do this I get a lot of errors from gevent/core.c before a
> "gcc failed" message. I'm working on CentOS5.2 on both 32 and 64bit
> platforms.
What versions of libevent does this OS provides?
$ yum info libevent
If it's a recent 1.4 then install libevent and libevent-devel packages
and you should be able to build it without downloading anything
manually.
>
> I'm statically building at the moment, direct from the tip I believe.
> Here's how I'm doing it:
>
> git clone http://github.com/schmir/gevent.git
> cd gevent
> git checkout origin/wip-all
> python setup.py build_libevent build install
>
> If I don't do this I get a lot of errors from gevent/core.c before a
> "gcc failed" message. I'm working on CentOS5.2 on both 32 and 64bit
> platforms.
>
> The above gets my install to version 0.13.0dev.
The above is not quite current. Please instead use the wip-download
branch to get a current version and build with
,----
| GEVENT_DOWNLOAD_LIBEVENT=1 python setup.py build install
`----
Sorry for the inconvenience. I'm still hoping to get those changes into
the mainline repo before the next release...
Regardless of presence of the socket error, I'd try to figure out why
it is possible
to call start_response() twice.
After that, I'd look into "bad pipe" issue - could you send me that
traceback too?