Closed Bug 1205653 Opened 9 years ago Closed 8 years ago

Vagrant: Add workaround for virtualbox shared folders sendfile bug

Categories

(Tree Management :: Treeherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: emorley, Unassigned)

References

Details

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 three years, but it still remains unfixed: https://www.virtualbox.org/ticket/9069 https://www.virtualbox.org/ticket/12597 The way this would manifest is: * file gets served via a sendfile syscall * file is modified (I think inside the VM? not sure if the same occurs if modified outside the VM) * file is served again, but is either (a) the old version, (b) a truncated copy of the old version, (c) a longer version of the old version but with garbage appended. (Depends on whether the file length stayed the same or increased/decreased). There have been reports that this doesn't affect people using NFS. This vagrant ticket has the workaround, which is to disable sendfile: https://github.com/mitchellh/vagrant/issues/351#issuecomment-1339640 The Vagrant docs now even mention this issue: https://docs.vagrantup.com/v2/synced-folders/virtualbox.html Now since we're using WhiteNoise (and not Apache httpd or Nginx), we'll need to disable in Gunicorn, which is now possible in Gunicorn >= v19.2: https://github.com/benoitc/gunicorn/commit/2849147f8aeb990c4f55a168e3d32ec2167ca093 https://github.com/benoitc/gunicorn/issues/856 ...by using `--no-sendfile` on the CLI: http://docs.gunicorn.org/en/latest/settings.html#sendfile We'll want to make sure sendfile is still enabled outside of the Vagrant environment, for stage/prod performance reasons.
Assignee: nobody → emorley
Ideally we would be able to disable sendfile via an environment variable, and so avoid having to add complexity to the run_gunicorn script. Filed: https://github.com/benoitc/gunicorn/issues/1252
In the newly release gunicorn 19.6.0 sendfile can now be disabled by defining `SENDFILE=0` in the environment: http://docs.gunicorn.org/en/latest/settings.html#sendfile
Wontfix since we're going to move towards docker instead (bug 1169263).
Assignee: emorley → nobody
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Component: Treeherder: Docs & Development → TreeHerder
You need to log in before you can comment on or make changes to this bug.