Infrastructure worth keeping — and kept patched.

Does the build cache survive a restart? A real test

You restart the cache server, or it crashes, or the container is replaced. Do your stored build results come back? We tested a clean stop, a forced kill and a wrong data folder with FosterStack Cache 0.2.1 and a real Gradle build.

The short answer

The results live in the data folder, not in the running server. If that folder survives, your cache survives.

What we ran

A four-module Gradle 9.8.0 project (the one from Gradle build cache for a monorepo) against a server set up with FSCACHE_DATA_DIR pointing at a folder. Every build used a fresh copy of the project and an empty Gradle home, so the only shared thing was the server. All four builds ended with BUILD SUCCESSFUL. "From cache" counts the four compileJava tasks that printed FROM-CACHE.

StepServer state before the buildEntries in the status pageFrom cache
1. First buildNew, empty data folder A0, then 13 afterwards0 of 4
2. Clean restartStopped normally, started on folder A13 (same as before)4 of 4
3. CrashKilled with kill -9, started on folder A13 (same as before)4 of 4
4. Wrong folderStarted on a different empty folder B00 of 4

The status page is the server's /statusz address. It showed the same 13 entries and the same size in bytes right after each restart, before any build ran.

One limit of this test

We killed the server while it was idle. We did not kill it in the middle of an upload, so this page says nothing about a half-written result. What we can say is that a crash with nothing in flight lost nothing.

If your cache comes back empty

An empty cache after a restart means the server is looking at a different folder than before. It is the same as step 4. Check that the data folder or volume is still the one you expect:

To copy the data somewhere safe, or to move it to another server, see back up and restore.

Run on FosterStack Cache 0.2.1 (macOS, arm64) with Gradle 9.8.0, Java 27.