Constant restarts - mtime not correct #45

Closed
sqren opened this Issue Aug 28, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@sqren

sqren commented Aug 28, 2012

I'm experiencing that node-dev is restarting constantly - like every second. I tried to debug it a bit, and found that the error is due to the function watchFile(file, onChange)

When using fs.watchFile, the returned objects are "curr" and "prev". However, curr.mtime is not set:

The curr object:

{ dev: 147980288,
  ino: 0,
  mode: 1000,
  nlink: 1000,
  uid: 0,
  gid: 0,
  rdev: 1735262208,
  size: 5781756674612134000,
  blksize: 301959934,
  blocks: 1346170128,
  atime: Tue, 28 Aug 2012 16:08:48 GMT,
  mtime: Thu, 01 Jan 1970 00:00:00 GMT,
  ctime: Thu, 01 Jan 1970 00:02:16 GMT 
}

The prev object:

{ 
dev: 2049,
  ino: 2049,
  mode: 33188,
  nlink: 2,
  uid: 1000,
  gid: 1000,
  rdev: 0,
  size: 17592186046863,
  blksize: 8,
  blocks: 1346170102,
  atime: Tue, 28 Aug 2012 16:08:22 GMT,
  mtime: Tue, 28 Aug 2012 16:08:48 GMT,
  ctime: Thu, 01 Jan 1970 00:00:00 GMT 
}

I'm aware this is not a direct bug in node-dev, but maybe you are aware of the problem?

I'm running Ubuntu as guest on a Macbook Pro. The files are located in OSX in a shared folder.

As a quick fixed i've changed the script from checking on mtime to atime.

@fgnass

This comment has been minimized.

Show comment Hide comment
@fgnass

fgnass Aug 30, 2012

Owner

Okay, that's really strange. I googled a bit and didn't find a single issue similar to yours. BTW, in the example you posted both cur and prev actually do have a mtime property. I assume this a copy & paste error?

Owner

fgnass commented Aug 30, 2012

Okay, that's really strange. I googled a bit and didn't find a single issue similar to yours. BTW, in the example you posted both cur and prev actually do have a mtime property. I assume this a copy & paste error?

@sqren

This comment has been minimized.

Show comment Hide comment
@sqren

sqren Aug 30, 2012

I assume curr.mtime is not set since it defaults to 1970/01/01 which is obviously wrong :)
When I type the command "ls -l file" I can see the modification date (2012/08/28), so it is set, but node doesn't seem to access it.

sqren commented Aug 30, 2012

I assume curr.mtime is not set since it defaults to 1970/01/01 which is obviously wrong :)
When I type the command "ls -l file" I can see the modification date (2012/08/28), so it is set, but node doesn't seem to access it.

@fgnass fgnass closed this in e45f3d9 Sep 7, 2012

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