Skip to content

Gatsby redux save-state causes excessive disk usage #39282

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

Open
2 tasks done
ankurparihar opened this issue Apr 21, 2025 · 0 comments
Open
2 tasks done

Gatsby redux save-state causes excessive disk usage #39282

ankurparihar opened this issue Apr 21, 2025 · 0 comments
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@ankurparihar
Copy link

Preliminary Checks

Description

Due to not handling of failure here, for any failed i, files from 0 - i-1, remains on the disk, and with each build they keep growing resulting in high disk usage.

writeFileSync(
reduxChunkedPagesFilePrefix(targetDir) + i,
v8.serialize(values.slice(i * chunkSize, i * chunkSize + chunkSize))
)

Each build creates a unique tmpdir - https://github.com/gatsbyjs/gatsby/blob/e8e17e774c4a90333a2277b44733bb4b48f2e102/packages/gatsby/src/redux/persist.ts#L237C18-L237C29

In scenarios, where buffer size exceeds serialization limits, it breaks the for loop.

Reproduction Link

NA

Steps to Reproduce

Cannot share as it's private repo.

Here's a screen recording

2.mp4

Expected Result

Files should be cleaned up properly

Actual Result

Files are not being cleaned up

Environment

NA

Config Flags

NA

@ankurparihar ankurparihar added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 21, 2025
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

1 participant