Skip to content

refs: the transient-signature classifier calls git's "Error in the HTTP2 framing layer" PERMANENT, so a transient transport fault kills the whole resolution instead of retrying #284

Closed

Description

@aitrawog

The defect

refs/git.go's transient-signature classifier does not recognise git's spelling of the HTTP/2 framing fault, so a transient transport fault is classified as permanent and aborts the whole operation instead of being retried.

var gitOpTransientRe = regexp.MustCompile(
	`(?i)(rpc failed|http/2|connection (reset|refused|closed|aborted)|could not resolve host|failed to connect to|timed out|early eof|network is unreachable|transfer closed with outstanding|hung up unexpectedly|unexpected disconnect|empty reply from server|returned error: 5\d\d)`,
)

The list carries http/2 — with a slash. Git writes Error in the HTTP2 framing layer — no slash. The two never meet.

RCA

Mechanism. runGitOp decides retryability from git's stderr:

if !timedOut && !gitOpTransientRe.MatchString(lastDetail) {
	break // permanent failure — retrying cannot help
}

gitOpTransientRe does not match Error in the HTTP2 framing layer, so the loop takes the break at attempt 0 and the bounded retry (2 retries, 500 ms / 1 s backoff) never runs. The failure then propagates as a hard error out of GitResolveRef.

Missed control. The classifier's vocabulary is hand-written and is never checked against the strings git actually emits. The positive retry coverage in refs/git_op_timeout_test.go (TestGitOpRetriesAfterKilledConnection) produces its signature from the test's own HTTP backend, which kills the socket and yields curl's reset spelling — a different word from the one git writes for an HTTP/2 framing fault. Every spelling in the list is asserted; none is derived. A whole fault class can sit outside the list and nothing notices.

Blast radius. Every charly marketplace generate and charly marketplace drift in the org resolves remote refs through this classifier. One transient HTTP/2 fault at any of ~1400 resolutions aborts the entire run — and with it the CI job that owns the corpus, the deployment, and the auto-merge arm.

Observed. opencharly/marketplace run 40922093306, attempt 1, 2026-10-29T17:36:44Z — the corpus's own build job, at entity 253 of ~1400:

charly marketplace: collect entities: resolve @github.com/opencharly/layer-golang:v2026.272.0137: resolving github.com/opencharly/layer-golang:v2026.272.0137: git ls-remote https://github.com/opencharly/layer-golang.git v2026.272.0137: exit status 128
fatal: unable to access 'https://github.com/opencharly/layer-golang.git/': Error in the HTTP2 framing layer

layer-golang is present and reachable and its tag exists — the fault is in the transport between the runner and github.com, not in the repository.

Measured against the shipped pattern:

MISS permanent | fatal: unable to access '...': Error in the HTTP2 framing layer
OK  transient | error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
OK  permanent | fatal: unable to access '...': gnutls_handshake() failed: ...
OK  permanent | fatal: repository 'https://github.com/x.git/' not found

Rate: this was the only failure among the last 31 runs of that workflow — about one fault per ~43 000 resolutions. At that rate three consecutive failures are ~1e-14, so the retry that the classifier denied would have made this class effectively impossible.

The root fix

  1. Match git's real spelling. The transient vocabulary must carry the slashless http2 form alongside http/2.
  2. Derive the vocabulary instead of hand-writing it. A fixture-driven test must pin the classifier against the REAL stderr strings git emits for each known fault class — the HTTP/2 framing fault, the reset, the early EOF, the empty reply — and assert that a genuinely permanent failure (404, 403, a missing repository) is still classified permanent and still fails fast with exactly ONE request. A list that only ever grows by hand is a list that can miss a class again.

Acceptance (R7 — coverage must fail without the change)

  • A test that feeds the classifier the recorded stderr of a real HTTP/2 framing fault asserts it is transient, and that the operation it guards is retried — the request count must show more than one attempt. Without the fix this test fails.
  • The permanent cases keep failing fast with exactly ONE request, so the widening does not turn permanent failures into retries (the existing TestGitOpDoesNotRetryPermanentFailure must keep passing).
  • The test must run OFFLINE — a fixture of recorded stderr strings, not a live network call (R8).

Note on the reproduction

The failure is transport-dependent and cannot be forced from inside the repo, so the regression test pins the CLASSIFIER (a pure function over recorded stderr) rather than the network. That is the part that was missed: the network behaviour was always covered; the classification was not.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

Activity

  1. aitrawog commented on Oct 29, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — the resolver's transient-signature classification, and the fixture-driven vocabulary that replaces it.

    What is claimed. refs/git.go's gitOpTransientRe and the coverage around it. The defect is measured in the issue body: the classifier lists http/2 (with a slash) while git writes Error in the HTTP2 framing layer (no slash), so a transient transport fault is classified permanent, runGitOp breaks out of its retry loop at attempt 0, and the whole resolution aborts.

    Why this repo. The classifier and runGitOp are here, in refs/git.go. The consumer that tripped over it — opencharly/marketplace's corpus regeneration — is a different repo and reaches this code through the pinned charly.

    Next. A PR here: widen the transient vocabulary to git's real spelling, and add the fixture-driven test that pins the classifier against RECORDED stderr strings for each known fault class, so the list is derived rather than hand-grown. The permanent cases must keep failing fast with exactly one request.

    Status. Next update at the PR, or when the classification changes.

    Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

  2. self-assigned this
    on Oct 29, 2026
  3. aitrawog commented on Oct 29, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the fix for #284 is open; the gate is green on the committed tree.

    What is done. The transient-fault vocabulary in refs/git.go is now a table of fault classes, and the class names are the key a recorded fixture table is keyed by. refs/git_transient_signatures_test.go (the record and the behaviour) references no new production symbol, so it runs against any revision of refs/git.go — which is what makes it the red proof: against origin/main's production code exactly one recorded fault turns red, git's slashless Error in the HTTP2 framing layer, the string that killed the corpus's regeneration at entity 253 of ~1400. refs/git_transient_classes_test.go holds the accountability half, including the rule that every class in the production table is backed by a record — a class added without one fails the test.

    What was run. The repo's own CI gate on the committed tree: build, test, gofmt and golangci-lint v2.13.2, all green, zero issues. The linter must run under the toolchain go.mod declares (go1.26.x): v2.13.2 embeds a type-checker that reads only export-data version 4, and go1.27's standard library writes version 5, so a newer local toolchain fails the lint in an unrelated package. AGENTS.md's build section now says so.

    Next. The org validator's verdict on this head. Every finding it raises is fixed in one appended commit, never filed away.

    Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

  4. added a commit that references this issue on Oct 29, 2026
    b03be49
  5. aitrawog commented on Oct 29, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the classifier is fixed and the issue is closed by hand.

    The fix. refs/git.go's transient-fault vocabulary is now a table of fault classes (gitOpTransientSignatures) and a classifier (transientFaultClass); the class names are the key a recorded fixture table is keyed by, so a class added without a record fails the test. The defect — the pattern http/2 (WITH a slash) never meeting git's Error in the HTTP2 framing layer (WITHOUT one), so a transient transport fault was classified permanent and the retry loop broke at attempt 0 — is fixed.

    The proof. refs/git_transient_signatures_test.go references no new production symbol, so it runs against ANY revision of refs/git.go: against the pre-fix code exactly ONE recorded fault turns red — the slashless HTTP/2 framing fault — and every other recorded transient class and every recorded permanent failure is unaffected. The permanent classes still fail fast with exactly one attempt.

    The merge. Squash commit b03be49d3bd35da3b165464a7d76e69949e670b0, merged 2026-10-29T17:56:20Z by the native auto-merge arm after the org validator's ## Review — PASS. Tag v0.2026302.1756 points at that squash commit; the served tip is 9d730c03, the tag-on-merge CHANGELOG commit one commit above the tag.

    Why by hand. The merge was performed by github-actions[bot], which does not close a Closes #N issue on its own.

    Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions