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

Comments

Projects
None yet
5 participants
@drnic

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

This comment has been minimized.

Show comment
Hide comment
@drnic

drnic Jul 16, 2012

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

drnic commented Jul 16, 2012

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

@mitchellh

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Jul 16, 2012

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.

mitchellh commented Jul 16, 2012

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

This comment has been minimized.

Show comment
Hide comment
@Maher4Ever

Maher4Ever Jul 16, 2012

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)

Contributor

Maher4Ever commented Jul 16, 2012

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

This comment has been minimized.

Show comment
Hide comment
@thibaudgg

thibaudgg Jul 30, 2012

Member

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

Member

thibaudgg commented Jul 30, 2012

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

@ideasasylum

This comment has been minimized.

Show comment
Hide comment
@ideasasylum

ideasasylum Jul 30, 2012

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

Contributor

ideasasylum commented Jul 30, 2012

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

This comment has been minimized.

Show comment
Hide comment
@thibaudgg

thibaudgg Jul 30, 2012

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.

Member

thibaudgg commented Jul 30, 2012

@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

This comment has been minimized.

Show comment
Hide comment
@ideasasylum

ideasasylum Jul 30, 2012

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

Contributor

ideasasylum commented Jul 30, 2012

@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

This comment has been minimized.

Show comment
Hide comment
@thibaudgg

thibaudgg Jul 30, 2012

Member

Yep, sadly.

Member

thibaudgg commented Jul 30, 2012

Yep, sadly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment