tailscale / tailscale/go-cache-plugin

go-cache-plugin: stale build object served after a source change (shared cache)

Open
#23 1 comment 0 reactions 0 assignees View on GitHub

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:

  1. The plugin keys purely on the actionID that cmd/go provides. 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 considered cmd/go's responsibility, and this is really a cmd/go actionID-completeness issue rather than a plugin one?
  2. Get returns the cached object without verifying its content against the requested outputID (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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.