question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ungit crashes with rapid file system modification

See original GitHub issue

(This problem has only come up for me with Rust projects, due to the nature of the build procedure)

To reproduce easily:

  • create an empty Cargo project: cargo new ungit_poc
  • in a new shell, run ungit in that folder: cd ungit_poc && ungit
  • in the first shell, run cargo: cargo check or cargo build

Ungit crashes with an error similar to:

Error: ENOENT: no such file or directory, watch '<project_dir>/target/debug/deps/rmetaY6KMh5'

This happens because the target directory is extremely volatile during compilation/checking, and ungit doesn’t seem to be written in such a way that handles extremely rapid filesystem mutation.

There are two ways to fix this:

  1. Ensure Ungit does not attempt to watch files in .gitignore/.ignore
  2. Change how FSWatcher is being used so that rapid changes won’t cause this race condition

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wmertenscommented, Jul 17, 2022

right, this seems like a bug with node-watch, where it tries to watch newly created folders but they’re already removed by the time it gets to it.

Mostl likely the bug is here https://github.com/yuanchuan/node-watch/blob/5743e51a861bfe3d372a99dd388626b324905065/lib/watch.js#L302-L317

@campbellcole would you mind opening an issue on node-watch?

0reactions
campbellcolecommented, Jul 17, 2022

@wmertens will do. Thanks for your time 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · FredrikNoren/ungit - GitHub
Anywhere. - Issues · FredrikNoren/ungit. ... Tries to watch files that have been ignored by gitignore ... ungit crashes with rapid file system...
Read more >
ungit - npm
If you're running MacOSX Mavericks and Ungit crashes after a few seconds; try updating npm and node. See #259 and #249 for details....
Read more >
Shared pain [LWN.net]
Well, if you define the transaction as an entity, then it gets written to its own FILE. If the system crashes then you...
Read more >
File Systems Unfit as Distributed Storage Backends
By running in user space and fully controlling the I/O stack, it has enabled space-efficient metadata and data checksums, fast overwrites of erasure-coded...
Read more >
File systems unfit as distributed storage backends
For a decade, the Ceph distributed file system followed the ... In 13th USENIX Conference on File and Storage Technologies (FAST 15).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found