Skip to content

workflows: fix TOCTOU in write_json and make writes atomic for good measure#139

Merged
msullivan merged 1 commit into
mainfrom
write-json-atomic
Jun 24, 2026
Merged

workflows: fix TOCTOU in write_json and make writes atomic for good measure#139
msullivan merged 1 commit into
mainfrom
write-json-atomic

Conversation

@msullivan

Copy link
Copy Markdown
Contributor

We were doing an exists() check but then doing the write afteward,
but this meant there was a race condition window.

Possibly we should be using sqlite?

…easure

We were doing an `exists()` check but then doing the write afteward,
but this meant there was a race condition window.

Possibly we should be using sqlite?
@msullivan msullivan requested a review from fantix June 23, 2026 16:31
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vercel-py Ready Ready Preview Jun 23, 2026 4:31pm

Request Review

@fantix fantix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Possibly we should be using sqlite?

This depends on the workflow JS CLI/UI - this toolset also consumes the local fs for workflow observability.

@msullivan

Copy link
Copy Markdown
Contributor Author

Possibly we should be using sqlite?

This depends on the workflow JS CLI/UI - this toolset also consumes the local fs for workflow observability.

Oh, I didn't realize we had a fixed format. OK.

@msullivan msullivan merged commit 496e1d9 into main Jun 24, 2026
13 checks passed
@msullivan msullivan deleted the write-json-atomic branch June 24, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants