On Sat, May 14, 2016 at 08:27:05PM +0200, Roberto De Ioris wrote:
> So, at this point i think the current behaviour (default is RFC-friendly,
> but not apache friendly) is the "right" one. Probably we should add this
> to the "ThingsToKnow" doc page.

I wouldn't call that "RFC-friendly." The RFC merely states that the
server is not obligated to close stdin. If it said "must not close
stdin" then you could claim that current behaviour is RFC-compliant.
However, the RFC merely leaves it up to the implementation, and the
current uWSGI implementation is neither right nor wrong. To my
knowledge, of all common CGI implementations, uWSGI is the only one that
doesn't close STDIN after POST. All of the following do, and you will
agree they probably cover 95% of the CGI market:

- Apache
- Fcgiwrap
- Lighttpd

So, of course, you could stick to your guns and claim that uWSGI is not
technically violating the RFC, and therefore you don't have to change
anything. However, is there a good reason to keep STDIN open after POST
is done?  Is there a situation where this would be useful?

Once all of POST is received, the CGI is supposed to produce output and
exit, so keeping STDIN open just leaves an extra fd open for the
duration of that CGI's execution. On a busy system, this can contribute
to filedescriptor exhaustion.


-- 
Konstantin Ryabitsev
Linux Foundation Collab Projects
Montréal, Québec
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to