Skip to content

fix(astro): Queue concurrent writeToDisk calls#15454

Merged
Fryuni merged 2 commits intomainfrom
store-race-condition
Feb 10, 2026
Merged

fix(astro): Queue concurrent writeToDisk calls#15454
Fryuni merged 2 commits intomainfrom
store-race-condition

Conversation

@Fryuni
Copy link
Member

@Fryuni Fryuni commented Feb 10, 2026

Changes

When multiple store.set() calls triggered overlapping writes, the second write could be silently dropped because #writeFileAtomic retried with stale serialized data. Writes are now queued at the writeToDisk() level so that each write re-serializes fresh data.

Testing

There is a new unit test reproducing the scenario and validating the correct behavior.

Docs

No change is needed in docs.

@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: f885239

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Feb 10, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing store-race-condition (f885239) with main (50c9129)

Summary

✅ 9 untouched benchmarks

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
@Fryuni Fryuni merged commit b47a4e1 into main Feb 10, 2026
27 checks passed
@Fryuni Fryuni deleted the store-race-condition branch February 10, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition in store.set can cause data store corruption

3 participants