Skip to content

fix(k8s): hold the copy source until the destination ends - #3712

Merged
dan-petty merged 3 commits into
mainfrom
fix/3695-volume-move-copy-end
Nov 6, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/3695-volume-move-copy-end

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The source side of a volume copy now keeps its stdout open until the destination has ended. Before, a destination slower than the source lost the end of the stream (connection reset by peer, or a short copy), and the move failed at the copy step.

The source runs tar ... && exec cat, and a named pipe joins the stdout of the destination to the stdin of the source. GNU tar ends at the end-of-archive marker, so the destination ends by itself, and a failure on either side still fails the copy. The command still starts one program through run_subprocess. The digest comparison and the one retry stay. This unblocks the moves of #2147.

Closes #3695

Change: openspec/changes/archive/2026-11-06-3695-volume-move-copy-end/

… ended

The end of the source's stdout loses the data that still waits on the path
to a slower destination. The source now runs cat after tar, and a named pipe
joins the stdout of the destination to the stdin of the source.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 6, 2026
@dan-petty

dan-petty commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner Author

Evidence for the change. Temporary pods ran on the control-plane node (source) and on the worker node with the most free disk (destination), kubectl 1.37.1, k3s 1.37.2. The pods are deleted. The copies ran through the real _copy_argv and run_subprocess of this branch.

Live measure of the new form:

Data Complete copies Notes
Real tar of 3,030 entries, 504 MiB (small and large files, a sparse file, a link, owner 472) 20 of 20 digest of the command equal on both sides
100 MiB of random bytes 20 of 20 sha256sum equal on both sides
Same two data kinds, destination limited to 200 millicores 6 of 6 and 6 of 6 the plain pipe ran once there and was complete, so this row shows that the form works, not that the old form failed
The old pipe, same session 4 of 5 one connection reset by peer

Failure cases, each with the new form. Each copy failed (exit code that is not 0), no temporary directory stayed on the workstation, and the retry of the command (empty /dst, copy again) gave equal digests: destination directory missing (2), source directory missing (2), remote destination tar killed (137), remote source tar killed (2, Unexpected EOF), local destination kubectl killed (137), local source kubectl killed (2, Unexpected EOF).

A hold that closes the stdout of the source (exec cat >/dev/null) kept the fault: 2 of 3 copies of the real tar and 2 of 2 of the random stream failed.

fail-to-pass (uv run devops ci fail-to-pass --base origin/main): 3 tests fail on the base and pass on the branch (test_the_copy_pipes_gnu_tar_between_the_two_pods_through_the_api_server, test_the_source_of_the_copy_holds_until_the_destination_ended, test_the_copy_makes_the_pipe_that_holds_the_source_and_removes_it).

Full uv run devops ci (before the last rebase): all rows pass except the audit row and the test row. The audit row failed on the oauthlib advisory, which main fixed in #3705; after the rebase uv run devops ci --only audit passes. The test row has 19,138 passed and 4 failed plus 1 error, and these are the known host failures: tests/crypto/test_ssh.py, tests/telemetry/test_config_env_overrides.py, tests/commands/test_devcontainer_install_tools_dry_run.py and tests/ai/test_tool_executor_contract.py (#3585). The test row took 7m26s (#3593).

A cut-off with SIGKILL (the timeout of run_subprocess) skips the cleanup of bash, so an empty directory with the named pipe stays in the temporary directory of the workstation. It holds no data.

@dan-petty
dan-petty marked this pull request as ready for review November 6, 2026 01:21
@dan-petty
dan-petty merged commit c7c5556 into main Nov 6, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/3695-volume-move-copy-end branch November 6, 2026 01:31
dan-petty pushed a commit that referenced this pull request Nov 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.64.0](v0.63.2...v0.64.0)
(2026-11-06)


### Features

* **roadmap:** let the step guard allow a recorded test removal
([#3715](#3715))
([f025406](f025406))
* **roadmap:** require the eval replay for a stage check change
([#3716](#3716))
([76e8301](76e8301))
* **roadmap:** restart a suspended job on a comment of a person
([#3699](#3699))
([be8d18a](be8d18a))
* **roadmap:** the verifier reads the repository and repairs a plan
twice ([#3710](#3710))
([c1191e2](c1191e2))
* **service:** chart the Service and filter the CLI dashboard by job
([#3704](#3704))
([fecc6fb](fecc6fb))


### Bug Fixes

* **deps:** upgrade oauthlib to fix GHSA-3jp2-3mrg-2vxc
([#3709](#3709))
([6a88012](6a88012)),
closes [#3705](#3705)
* **k8s:** hold the copy source until the destination ends
([#3712](#3712))
([c7c5556](c7c5556)),
closes [#3695](#3695)
* **k8s:** the gateway stops using the 16 GiB tier
([#3697](#3697))
([842effc](842effc))
* **roadmap:** keep angle-bracket text of a code span in refine
([#3711](#3711))
([396962e](396962e))
* **roadmap:** P1 items pass the planned limit
([#3698](#3698))
([63589f0](63589f0)),
closes [#3692](#3692)
* **roadmap:** refine blocks an item with an open dependency
([#3696](#3696))
([89fbb08](89fbb08))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): volume move loses the end of its copy

1 participant