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

not updating race condition fix #249

Merged
4 commits merged into from Jul 29, 2015
Merged

not updating race condition fix #249

4 commits merged into from Jul 29, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jul 29, 2015

This patch fixes #216 by tracking the updating status and refusing to close watchers while the new bundle is being generated. Previously, a race condition would remove watchers from fwatchers when 2 parallel 'update' events would use the same data structures.

This issue is easy to replicate on a big project by doing: while true; do touch main.js; done. Before, this would stop watchify from tracking changes to main.js very quickly. With this fix, watchify keeps on cranking.

@zertosh
Copy link
Member

zertosh commented Jul 29, 2015

lgtm! somewhat related, how do you feel about scheduling the update event on a debounce instead of a throttle?

@zertosh
Copy link
Member

zertosh commented Jul 29, 2015

oh wait... if you choose not to call bundle() on update, then nothing ever sets updating back to false. updating = true should probably happen in the b.on('bundle', ...), right?

@ghost
Copy link
Author

ghost commented Jul 29, 2015

When I put updating=true in the bundle event, the test suite hangs, so I put it back where it was previously.

@zertosh
Copy link
Member

zertosh commented Jul 29, 2015

Ah because this line in browserify should read output.pipe(concat(...));. The tests pass in a callback to bundle() instead of reading from the output stream. When used in that form, because of that bug, end never happens and the tests hang.

I'm stuck at work right now, but I can fix that later tonight.

@ghost
Copy link
Author

ghost commented Jul 29, 2015

Fixed upstream issue in browserify 11.0.1.

@zertosh
Copy link
Member

zertosh commented Jul 29, 2015

Nice! Just tried 227be4e and the tests pass now 😄

@ghost ghost merged commit edc6fc3 into master Jul 29, 2015
@MrMMorris
Copy link

shoot, looks like this didn't fix my issue... Maybe it's related to the fsevents issue :(

It seems only a couple files don't trigger rebuilds

@goto-bus-stop goto-bus-stop deleted the not-updating-fix branch July 7, 2019 17:56
This pull request was closed.
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

Successfully merging this pull request may close these issues.

Watchify not rebuilding
2 participants