Virtualbox has a bug where when using shared folders, the contents of a file transferred using sendfile can sometimes end up corrupted. A ticket for this issue has been open against Virtualbox for several years, but it still remains unfixed:
As a result, a pref was added to gunicorn to allow disabling:
However since --no-sendfile should only be used in local development environments, this means our in-repository wrapper scripts that invoke gunicorn need to be different for dev vs prod.
To save having to add further complexity to these scripts (and to also help the case where someone invokes gunicorn directly rather than using the scripts), it would be great if a GUNICORN_DISABLE_SENDFILE environment variable (or similar) could be used instead. We'd then just define this only in the local Vagrant development environment's puppet scripts, leaving prod unaffected.
If this is something that would be accepted, I'd be happy to open a PR. (I realise we can't just add environment variables for every single supported setting, but wasn't sure where the line lay, given things like #1205 were accepted.)
Are there already servesr that does something like it? In that case we may look at the environment variable they are using instead of using our own. Imo having smth "SENDFILE=no" would be better. thoughts?
A cursory search does not reveal a typical environment variable for this purpose in other server software. I would be fine with SENDFILE, though. We should be liberal about the value: 0, 1, yes, no, true, false, case insensitive?
Allow disabling sendfile via an environment variable
add support for the `SENDFILE` environment variable.
Docs: Spelling corrections & markup tweaks
Fixes the changelog bullets added for #1252, as well as a number of
spelling corrections and markup improvements.
Thank you for adding this! :-)