-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Extra queries slow rebuild on file change when using gatsby-source-filesystem #20787
Comments
Can you confirm that it is not happening with version |
From the repro repo it looks like he bisected it. I'll have a look to see whether I can repro. Perhaps the queue is shared / retained which might lead to incorrect events being picked up. |
Ok, I can repro (at least between .22 and .23).
I'll look into it. Thanks for the report and the repro :) |
Solution: do not rebind the same event :) Will create a PR. |
The queue was retained for develop mode which led to the same event handlers being registered over and over again, which led to strange artifacts in the output. With this change the events are aggressively deregistered from the queue when it finishes or fails. Fixes #20787
The queue was retained for develop mode which led to the same event handlers being registered over and over again, which led to strange artifacts in the output. With this change the events are aggressively deregistered from the queue when it finishes or fails. Fixes #20787
FYI: this may have been a red herring. While the count was definitely broken, it seems develop had another problem with redundant build steps being triggered. This should be fixed after #20836 merges. |
Fix was published in Thanks for the report! |
Description
Since v2.18.23, changes to files which are watched by gatsby-source-filesystem trigger rebuilds which , after time, involve execution of hundreds of queries and poor rebuild performance.
Steps to reproduce
See this example
Expected result
See this example
Actual result
See this example
Environment
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.21.1 - ~/.yarn/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 79.0.3945.130
Safari: 13.0.4
npmPackages:
gatsby: ^2.19.1 => 2.19.1
gatsby-plugin-react-helmet: ^3.1.16 => 3.1.16
gatsby-source-filesystem: ^2.1.40 => 2.1.40
gatsby-transformer-code: ^0.1.0 => 0.1.0
npmGlobalPackages:
gatsby-dev-cli: 2.5.43
The text was updated successfully, but these errors were encountered: