Skip to content

flake: production Kind Clear/Fork lifecycle intermittently returns HTTP 409 #2401

Open

Description

@jbeda

Failure

TestKindExecutionProductionClearForkLifecycle intermittently receives HTTP 409 while publishing the first fork after the scripted source prompt completes.

stage=scripted_source step=prompt_stream elapsed=1m26.528s
stage=scripted_source elapsed=1m39.526s next=source_ready
stage=source_ready elapsed=148ms next=publish_successors
production_qualification_test.go:1386: fork session status=409
--- FAIL: TestKindExecutionProductionClearForkLifecycle (101.72s)

Intermittency and PR relationship

  • The same test passed in 123.23s in the previous PR-head job, at d179b0578101d0ff7dd1fbc6ac00028f19587b41. That overall job was later canceled by the subsequent push; this individual test completed successfully before cancellation.
  • The production-profile job also passed on the PR's exact main base, e17d8394d365a94fb79258fa02a940625bfb99ff.
  • test: add opt-in workspace verification and cross-module workflow #2399 does not change this test, server/provider/controller implementation, production fixture, production qualification task, Kubernetes workflow, or dependency pins. It changes offline workspace/module tooling, metadata policy, docs, and a separate terminal startup-test socket fixture.
  • Classifying as a flake based on passing/failing runs with the relevant execution path unchanged. No same-SHA rerun or local Kind reproduction has been performed; the exact cause is not yet established.
  • Searched open/closed issues for the test name, fork-status signature, successor/409, and execution-related flakes, including CI: track flaky tests on main and PRs #2327; no matching dedicated issue found.

Investigation

source_ready establishes attachment readiness, not absence of an active run/operation. successorSession (production_qualification_test.go:1469) retries HTTP 503, but reports only status on HTTP 409 and discards the response problem code. The roughly two-second interval could include a preceding 503 retry, rather than one slow fork request.

A provider successor-reservation conflict maps through ErrPlacementChanged to HTTP 409. The reservation rejects active operations, unhealthy fences, and active run claims (internal/adapter/executioncontroller/store_lifecycle.go:177–192). Kubernetes status-update retry exhaustion is another conflict path. An unsuccessful execution-run release can also leave provider state behind: server cleanup logs the release error and continues without retry (internal/adapter/server/service.go:9469–9488). Session lease competition is a distinct HTTP-409 alternative.

These are hypotheses, not confirmed causes. A simple terminal-event-before-local-drain explanation is insufficient: the prompt helper consumes the whole SSE response, normal handler cleanup releases execution ownership before returning, and the local busy-session gate normally returns HTTP 412 rather than the observed 409.

The sanitized failure artifact was inspected. It is collected after the remaining suite tests and omits the distinguishing HTTP problem code, release/reservation diagnostics, and failure-time active-run state. Its later environment snapshots cannot identify the original conflict.

Follow-up

  • Preserve the sanitized HTTP problem code for every failed successor attempt, distinguishing placement conflict from session lease contention; do not log credentials or arbitrary response bodies.
  • Capture bounded failure-time reservation/release reason classes, active-run/operation presence and expiry, fence health, and Kubernetes CAS retry outcome.
  • Reproduce repeated Clear/Fork qualification under the production Kind profile and fix the confirmed cause with a targeted regression test.
  • Do not blindly retry all HTTP 409 responses or weaken run-exclusion/ownership checks to make the test pass.

Related flake tracker: #2327.

Activity

  1. added
    bug
    flake
    on Oct 17, 2026
  2. jbeda commented on Oct 28, 2026

    @jbeda
    ContributorAuthor

    Another occurrence on #2398 at f365ececf53ab94d518da319f2896b23fcbbf515:

    • Failed production-profile shard 3, workflow .github/workflows/k8s-e2e.yml.
    • TestKindExecutionProductionClearForkLifecycle failed at the initial fork, before Clear, with the same HTTP 409 signature:
    stage=scripted_source elapsed=1m39.921s next=source_ready
    stage=source_ready elapsed=1.447s next=publish_successors
    production_qualification_test.go:1386: fork session status=409
    --- FAIL: TestKindExecutionProductionClearForkLifecycle (102.52s)
    

    Additional passing/failing evidence:

    • The identical test/409 failed on main at 38c5023767c0d5a315648c9c43ddd6de411617cf, before this PR push: main shard-3 failure.
    • The preceding PR head, 93b2e352172c86d3829a481dcec203e8230ec2e2, passed shard 3.
    • A later main head, 1f9f81b500b2a68cb79d7b7648f1ca2cfc549c3e, also passed shard 3.

    The new PR delta changes only cmd/mecatui/ui/* and TUI documentation; it does not change this fixture or the server/provider/controller execution path. This corroborates the existing flake classification independently of the schedule UI changes.

    No same-SHA rerun or local Kind reproduction was performed for this occurrence. The log still omits the HTTP problem code, so the root cause remains unconfirmed. In particular, this is not proof of a simple SSE-terminal/drain race; the existing investigation's distinctions between reservation/release/CAS conflicts and session lease contention still apply. No broad 409 retry or weakened ownership/run-exclusion checks are proposed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugciflake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions