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

Immediately dirty optimistic functions when relevant paths modified. #9007

Merged
merged 4 commits into from Aug 11, 2017

Conversation

@benjamn
Copy link
Member

@benjamn benjamn commented Aug 11, 2017

Should fix #8988 and #8942.

Now that #8866 is the default behavior, it can take up to 5000ms for changes to files modified during the build process to be noticed.

Before #8866, when we called e.g. files.writeFile(path), a native file watcher would notice the change immediately, almost always before the build process read the file again. This was definitely racy, but we were getting away with it consistently... until #8866.

I was able to reproduce the problem in #8988 by running

echo some-local-package-name >> .meteor/packages

in an app with a local package of the given name. After debugging the endless rebuild cycle, I found that .meteor/versions was being rewritten by files.writeFile during the build process, but the file watching system was not noticing the change in time to prevent watch.isUpToDate from returning true. The change was finally detected when restarting the Watcher responsible for .meteor/versions, which of course triggered another rebuild, so the same problem kept happening again and again.

@benjamn benjamn added this to the Release 1.5.2 milestone Aug 11, 2017
@benjamn benjamn self-assigned this Aug 11, 2017
@benjamn benjamn requested review from hwillson and abernix Aug 11, 2017
Copy link
Member

@abernix abernix left a comment

LGTM. Your explanation makes a lot of sense!

Should fix #8988 and #8942.

Now that #8866 is the default behavior, it can take up to 5000ms for
changes to files modified during the build process to be noticed.

Before #8866, when we called e.g. files.writeFile(path), a native file
watcher would notice the change immediately, almost always before the
build process read the file again. This was definitely racy, but we were
getting away with it consistently... until #8866.

I was able to reproduce the problem in #8988 by running

  echo some-local-package-name >> .meteor/packages

in an app with a local package of the given name. After debugging the
endless rebuild cycle, I found that .meteor/versions was being rewritten
by files.writeFile during the build process, but the file watching system
was not noticing the change in time to prevent watch.isUpToDate from
returning true. The change was finally detected when restarting the
Watcher responsible for .meteor/versions, which of course triggered
another rebuild, so the same problem kept happening again and again.
@benjamn benjamn force-pushed the immediately-dirty-optimistic-functions branch Aug 11, 2017
@benjamn benjamn force-pushed the immediately-dirty-optimistic-functions branch to 9e4d160 Aug 11, 2017
benjamn added a commit that referenced this pull request Aug 11, 2017
Assuming #9007 fixes the file watcher timing problems, it should no longer
be necessary to disable the optimizations of #8866.
Copy link
Member

@hwillson hwillson left a comment

Nice catch @benjamn - looks great!

benjamn added 3 commits Aug 11, 2017
Assuming #9007 fixes the file watcher timing problems, it should no longer
be necessary to disable the optimizations of #8866.
@benjamn benjamn force-pushed the immediately-dirty-optimistic-functions branch from 9e4d160 to 4dfa9c3 Aug 11, 2017
@benjamn benjamn merged commit 93d0c5f into devel Aug 11, 2017
1 of 4 checks passed
1 of 4 checks passed
ci/circleci: Get Ready CircleCI is running your tests
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
CLA Author has signed the Meteor CLA.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.