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

Changes to files on NFS should be detected #120

Closed
alexeits opened this issue Dec 19, 2014 · 9 comments
Closed

Changes to files on NFS should be detected #120

alexeits opened this issue Dec 19, 2014 · 9 comments

Comments

@alexeits
Copy link

Expected: when a watched JS file on a mounted NFS share changes watchify should detect it
Actual: nothing happens, although any local changes are detected correctly

This functionality worked just fine in 2.1.1. It appears to be a regression in 2.2.1.

Setup details:

  • OS X Yosemite host
  • Ubuntu trusty guest in VirtualBox managed by Vagrant with synced_folder folder mounted via NFS
@blopker
Copy link

blopker commented Dec 26, 2014

I seem to be having this issue as well, but with VMware and Vagrant.

@blopker
Copy link

blopker commented Dec 27, 2014

According to paulmillr/chokidar#201, a default setting changed with regard to polling remote drives for changes. Watchify needs to re-enable polling for NFS mounts.

greensheep added a commit to greensheep/watchify that referenced this issue Jan 18, 2015
@skinofstars
Copy link

Hi, I wanted to add a +1 to this. I seem to be getting the same issue where I am watching files within a vagrant machine that's using NFS. I'm installed from npm using latest.

@skinofstars
Copy link

Ok, I tested a bit more and can confirm that patch referenced by greensheep resolves the issue. Is this something that could be merged in? Thanks.

@blopker
Copy link

blopker commented Feb 18, 2015

The problem with greensheep@40722d5 is that it won't use native file system events on systems that support it, like non NFS mounts. This is a major performance issue. To fix this correctly we need some way of using polling as a fallback if file system events aren't available.

That or allow us to turn on/off polling explicitly through the Watchify API if we know the file system is NFS.

@skinofstars
Copy link

Ok, well we can check if a file/folder is NFS using the stat command, stat -f -c %T foo.js

I'm not sure what system events we're looking for, but I'm happy to do more research. I suspect using stat would be a good enough solution for now though.

Something like

var exec = require('child_process').exec;
exec('stat -f -c %T .', function(err, res){
  console.log(res.replace(/\s+/g, '') === 'nfs');
});

@blopker
Copy link

blopker commented Feb 28, 2015

@skinofstars, it's not just NFS mounts that need polling. There's a discussion over at paulmillr/chokidar#242 (what watchify uses to 'watch') to figure out how to auto-detect what method to use. You should put your .02 in! 👍

@zertosh
Copy link
Member

zertosh commented Mar 23, 2015

Closing and moving the discussion to #162.

@zertosh zertosh closed this as completed Mar 23, 2015
@zertosh
Copy link
Member

zertosh commented Mar 30, 2015

Just published 3.0.0 (see #170), it has the ability to use polling, which will solve your NFS issue.

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

4 participants