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

Rollback DANGEROUSLY_DISABLE_OOM #14767

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions docs/docs/scaling-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ It's difficult to pin down exactly _how_ to fix a scaling issue. We have some re

Note: the application of these techniques should be considered analogous to a applying a bandage. A bandage solves the underlying issue, but at some indeterminate point in the future the underlying issue may be healed! In much the same way--treat these techniques as temporary and re-visit in the future if underlying scaling issues in Gatsby have since been resolved.

### `DANGEROUSLY_DISABLE_OOM`

Gatsby's caching mechanism persists a (possibly!) large `json` file to disk _in memory._ To opt-out of this, consider something like:

```json
{
"devDependencies": {
"cross-env": "^5.2.0"
},
"scripts": {
"build": "cross-env DANGEROUSLY_DISABLE_OOM=true gatsby build"
}
}
```

This will prevent caching, so it's recommended to only use this alongside the `gatsby build` command.

### `GATSBY_DB_NODES`

In preparation for future versions of Gatsby, we've enabled **experimental** support for a different mechanism for the persistence of nodes: [Loki](https://www.npmjs.com/package/lokijs). It's challenging to assess whether this could lead to unforeseen issues without breaking changes, so we've exposed it behind a flag while we continue to assess the impact to Gatsby applications.
Expand Down
10 changes: 0 additions & 10 deletions packages/gatsby/src/redux/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,4 @@ describe(`redux db`, () => {
// yuck - loki and redux will have different shape of redux state (nodes and nodesByType)
expect(_.omit(data, [`nodes`, `nodesByType`])).toMatchSnapshot()
})

it(`does not write to the cache when DANGEROUSLY_DISABLE_OOM is set`, async () => {
process.env.DANGEROUSLY_DISABLE_OOM = true

await saveState()

expect(writeToCache).not.toBeCalled()

delete process.env.DANGEROUSLY_DISABLE_OOM
})
})
4 changes: 0 additions & 4 deletions packages/gatsby/src/redux/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ const store = configureStore(readState())

// Persist state.
const saveState = () => {
if (process.env.DANGEROUSLY_DISABLE_OOM) {
return Promise.resolve()
}

const state = store.getState()
const pickedState = _.pick(state, [
`nodes`,
Expand Down