Skip to content

fix(cache): stop remote cache requests on Ctrl-C and fast-fail - #771

Merged
wan9chi merged 2 commits into
mainfrom
fix-remote-cache-cancellation
Sep 28, 2026
Merged

wan9chi merged 2 commits into
mainfrom
fix-remote-cache-cancellation

Conversation

@wan9chi

@wan9chi wan9chi commented Sep 27, 2026

Copy link
Copy Markdown
Member

Motivation

Remote cache requests ignored cancellation. After Ctrl-C or a failing task, vp run still waited for in-flight lookups, downloads, and uploads to finish or hit the 60s read timeout, and a task whose lookup finished after cancellation could still start.

Changes

  • Ctrl-C and fast-fail now share one cancel token: the Ctrl-C token is a child of the fast-fail token, so every fast-fail (including a pipe failure in run_child) cancels it too, while Ctrl-C still leaves running processes alone.
  • Remote fetches, archive downloads, and uploads race against that token. A cancelled download still waits for the archive check to close the .tmp file before removing it.
  • A task that's cancelled during its cache lookup doesn't start and doesn't restore cached outputs. Like a task that was never scheduled, it isn't shown, and it doesn't trigger fast-fail.
  • A cancelled upload keeps the local entry, and the summary shows the existing warning with cancelled as the reason.
  • Tests: unit tests for cancelling a fetch, an upload, and a download mid-body (the .tmp file is removed); e2e cases for Ctrl-C and fast-fail during a fetch, using a new vtt stalled-remote-cache helper that serves an endpoint that never responds. Neither needs Node, so they run on all platforms.
  • Updated docs/cancellation.md and the remote caching changelog entry.

Closes #766

Remote cache lookups, downloads, and uploads now stop as soon as the run
is cancelled, instead of holding `vp run` open until they finish or time
out. A task whose lookup was cut short doesn't start or restore outputs.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the fix-remote-cache-cancellation branch from ff718b3 to 524bc21 Compare September 27, 2026 16:53
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  -0.54%  [ -7.04% ..  +8.25%]  overhead  +268.20%
dynamic/access             change  +0.31%  [ -0.76% ..  +1.25%]  overhead   +13.18%
dynamic/access-relative    change  -0.23%  [ -0.87% ..  +0.99%]  overhead   +60.40%
dynamic/access-contended   change  -0.28%  [ -2.23% ..  +3.05%]  overhead   +14.88%
static/launch              change  +0.48%  [ -5.45% ..  +7.27%]  overhead  +734.29%
static/access              change  +0.19%  [ -0.69% ..  +1.10%]  overhead  +807.13%
static/access-relative     change  +0.11%  [ -0.93% ..  +0.96%]  overhead +1395.66%
static/access-contended    change  +0.16%  [ -0.83% ..  +1.33%]  overhead +3140.92%

macos

dynamic/launch             change  -0.39%  [ -4.65% ..  +4.59%]  overhead  +242.73%
dynamic/access             change  -1.20%  [-28.10% .. +15.08%]  overhead    +4.28%
dynamic/access-relative    change  +3.27%  [ -7.84% .. +80.23%]  overhead  +283.10%
dynamic/access-contended   change  -0.52%  [-87.00% ..  +7.24%]  overhead    +2.18%

windows

dynamic/launch             change  +0.60%  [ -5.23% ..  +6.94%]  overhead   +25.72%
dynamic/access             change  -0.37%  [-20.00% ..  +7.91%]  overhead    +1.12%
dynamic/access-relative    change  +0.00%  [-19.26% ..  +8.50%]  overhead    +2.83%
dynamic/access-contended   change  -0.51%  [ -9.55% ..  +7.43%]  overhead    +5.02%

@wan9chi
wan9chi marked this pull request as ready for review September 28, 2026 01:57
@wan9chi
wan9chi merged commit 45b667c into main Sep 28, 2026
19 checks passed
@wan9chi
wan9chi deleted the fix-remote-cache-cancellation branch September 28, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote cache requests ignore Ctrl-C and fast-fail

1 participant