Skip to content

Add file locking to dir cache - #3573

Merged
peterebden merged 7 commits into
thought-machine:masterfrom
peterebden:threadsafe-cache
Aug 20, 2026
Merged

Add file locking to dir cache#3573
peterebden merged 7 commits into
thought-machine:masterfrom
peterebden:threadsafe-cache

Conversation

@peterebden

Copy link
Copy Markdown
Collaborator

This should make it safer to run concurrent processes without them corrupting the shared cache.

I'm going to have a look at sharing it between the e2e tests, which are very slow on weaker machines (like CI) because they heavily rebuild the Go stdlib. That's nontrivial though so I will leave for a separate PR.

Comment thread src/core/lock_test.go Outdated
Co-authored-by: Samuel Littley <samuel.littley@toastwaffle.com>
@peterebden
peterebden merged commit 8a33019 into thought-machine:master Aug 20, 2026
13 checks passed
peterebden added a commit that referenced this pull request Aug 23, 2026
Stacked on #3573 

Now the cache is threadsafe, we can share it between e2e tests. It's not
super obvious but these have slowed down a _lot_ over time - as they
moved to `plz_repo_e2e_test` which is better separated but rebuilds
more, plugins added more downloads and (most significantly) we now build
the Go stdlib in tree rather than assuming it's on the system. This
isn't so bad on a powerful machine but it is bad on a weaker one (i.e.
all the CI machines).

I've also rationalised some of the plugin / Go versions in there. There
is possibly some future work to keep all these better aligned with the
parent repo - honestly we usually just forget (hence 10 version old
plugins and Go 1.24).

I've added the cache to CircleCI as well; otherwise it will always be
cold, and we can't deduplicate the work between everything in that case,
so we'd get no benefit without.
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