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

feat(gatsby): add DANGEROUSLY_DISABLE_OOM #13066

Merged
merged 12 commits into from
Apr 4, 2019
Merged

feat(gatsby): add DANGEROUSLY_DISABLE_OOM #13066

merged 12 commits into from
Apr 4, 2019

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Apr 3, 2019

Description

This adds a process.env variable called DANGEROUSLY_DISABLE_OOM to disable saving the redux state to disk. This helps with going out of memory in the bootstrap phase. The downside is that your build will be much slower as it will always build from a clean dir.

We won't put this variable inside our docs as it's a feature we don't want to highlight or people to use.

Related Issues

#12485

@wardpeet wardpeet requested a review from a team as a code owner April 3, 2019 05:54
@KyleAMathews
Copy link
Contributor

Is this intended as a temporary hack? E.g. once v8.seralize stuff gets figured out we remove this?

@muescha
Copy link
Contributor

muescha commented Apr 3, 2019

i would add it anyhow to documentation with an big warning to avoid more and more "hidden preferences" or avoid some surprising behavior.

anyhow it would name it somehow what it do and not what it avoid DANGEROUSLY_DISABLE_SAVING_REDUX_STATE

@pieh
Copy link
Contributor

pieh commented Apr 3, 2019

Yes it's meant to be temporary. Users are blocked on OOM issues and until v8.serialize land, there is nothing they can do to unblock themselves (other than monkey patching and commenting out JSON.stringify parts in saveState function.

@muescha This is intentionally not mentioning redux state. We don't want to encourage using it for the purpose of skipping redux state caching (as then we can never fix cache issues if users don't use it at all). This is only to unblock cases of out of memory issues. This will also be removed once proper fix is merged.

@wardpeet
Copy link
Contributor Author

wardpeet commented Apr 4, 2019

Yes temporary yes. Let me just remove the analytics and get this merged.

@wardpeet wardpeet added the status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response label Apr 4, 2019
@muescha
Copy link
Contributor

muescha commented Apr 4, 2019

maybe comment in code why its temporary and what it solves ... just to see it later in code reviews and don't forget to remove it later

@DSchau
Copy link
Contributor

DSchau commented Apr 4, 2019

@wardpeet I'm gonna pick up this PR and add some documentation if that's cool!

@wardpeet wardpeet requested a review from a team April 4, 2019 20:33
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to get this merged.

For context, I added a Scaling Issues document that we can link to if people are running into issues that this temporary feature may fix.

Longer term--let's make this document (and flag!) redundant and delete it/tweak the content after we land fixes re: #6656, #12566, and #12343.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants