Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events not firing over vagrant shared folder #53

Closed
drnic opened this issue Jul 16, 2012 · 8 comments
Closed

Events not firing over vagrant shared folder #53

drnic opened this issue Jul 16, 2012 · 8 comments

Comments

@drnic
Copy link

drnic commented Jul 16, 2012

Scenario:

  • Running listen (via kicker) inside vagrant
  • It is watching a file within a vagrant shared folder (e.g. /vagrant/README.md)
  • When I touch the file within vagrant, listen triggers (and kicker does its thing)
  • When I touch the file outside of vagrant, listen does not trigger
  • Yet, the filestamp of the watched file has changed as expected
@drnic
Copy link
Author

drnic commented Jul 16, 2012

/cc @johnbender @mitchellh (suggests from vagrant perspective?)

@mitchellh
Copy link

This is due to the way that the VirtualBox shared folder system is implemented. It doesn't properly trigger filesystem notification events on the guest if it is touched from the host (and vice versa as well).

I don't think this is a bug with this project or Vagrant. However, listen may be able to watch file system properties (file mtime and such) and see the differences.

@Maher4Ever
Copy link
Contributor

Listen has a polling adapter which does not depend on filesystem notifications. Could you try it and see if it helps? (To use it you have to enable the :force_polling option. See the readme for more info)

@thibaudgg
Copy link
Member

I just come back from vacation, this is still an issue?

@ideasasylum
Copy link
Contributor

I'm also having this same issue. Polling works fine for me (Lion as the host, Ubuntu 12.04 as vagrant) but I'd rather not eat up my processor time unnecessarily.

To understand this better: is this a problem outside of listen, or is it something which can be fixed in listen? I note elsewhere that Watchr appears to work in this scenario (I've yet to try it myself) and judging by their implementation they keep track of the a/m/ctime: https://github.com/mynyml/watchr/blob/master/lib/watchr/event_handlers/unix.rb

@thibaudgg
Copy link
Member

@ideasasylum Watchr use a different (evented) approach than Listen (that have some caveat, like not detecting new files). So if VirtualBox shared folder doesn't trigger filesystem notification events I think polling is the only option here. Sorry.

@ideasasylum
Copy link
Contributor

@thibaudgg ah, thanks for the explanation. If it was something that could be fixed I'd have had a go myself but polling seems like the best approach for the moment

@thibaudgg
Copy link
Member

Yep, sadly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants