Hi there,
I've created a minimal test case for the graceful reload issue we're
encountering on Ubuntu 10.04 at https://gist.github.com/chkwok/5890500. It
consists of three files:
1. app.wsgi file that's basically Hello World, except that it waits for
5 seconds before responding
2. run-server.sh that contains a single line, uwsgi --http :9090
--wsgi-file app.wsgi --touch-reload app.wsgi
3. test.py that contains the test case - fetch 127.0.0.1:9090, then
fetch again but touch the app.wsgi file after one second to simulate a
graceful reload during a request.
Also in the gist: two files containing the output of test.py and uwsgi
Versions: uwsgi 1.9.13, Ubuntu 10.04 with all patches applied. More details
are in the uwsgi log.
These lines caught my eye:
Sat Jun 29 11:20:40 2013 - *** app.wsgi has been touched... grace them
all !!! ***
gateway "uWSGI http 1" has been buried (pid: 5756)
...gracefully killing workers...
Gracefully killing worker 1 (pid: 5755)...
SIGPIPE: writing to a closed pipe/socket/fd (probably the client
disconnected) on request / (ip 127.0.0.1) !!!
uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 260]
IOError: write error
[pid: 5755|app: 0|req: 2/2] 127.0.0.1 () {26 vars in 277 bytes} [Sat
Jun 29 11:20:38 2013] GET / => generated 0 bytes in 1732 msecs
(HTTP/1.0 200) 1 headers in 44 bytes (0 switches on core 0)
worker 1 buried after 1 seconds
binary reloading uWSGI...
Did the master really kill the http connection before worker 1 has exited?
If it does, well, that may be the issue. The worker seems to behave
correctly - try to complete the request first, then exit, but the socket to
write to was invalidated already.
Hope this helps.
Kind regards,
Chi Ho Kwok
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi