tailscale / tailscale/go-cache-plugin
go-cache-plugin: stale build object served after a source change (shared cache)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 81
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Running many concurrent CI jobs against a single shared S3 cache prefix, a build occasionally compiles a package from stale source at a commit where that package's source has changed — the cache returns an object whose inputs no longer match. It surfaces as a coverage profile containing block ranges from two different revisions of the same file, and the affected job shows a ~99.9% cache-hit rate, so the stale bytes came from the cache, not a local rebuild. A manual purge of the prefix clears it; it recurs within a pipeline or two.
The failing job is only where it's detected. The same path would serve a stale object to a normal build silently, producing a binary from old source with no error — so we treat this as a correctness issue.
Questions after looking at code:
- The plugin keys purely on the actionID that
cmd/goprovides. For a cache shared across toolchains and build variants, should the key be salted with additional build context (toolchain version, cover mode, flags) — or is fully distinguishing builds consideredcmd/go's responsibility, and this is really acmd/goactionID-completeness issue rather than a plugin one? Getreturns the cached object without verifying its content against the requestedoutputID(the comment defers content-address checking to the toolchain). Would you accept a verify-on-GET (or read-only) mode that treats a hash mismatch as a miss and rebuilds, rather than returning stale bytes? For a shared multi-writer cache that would convert a silent stale-serve into a safe miss.
I can do the fix, if issue is accepted.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the plugin's actionID key construction and Get handling of outputID, then compare those assumptions with cmd/go's cache behavior for shared toolchains and variants; done requires an agreed fix scope and evidence that the stale shared-cache object is no longer served.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go
- Domain
- build-system, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100