Skip to content

Stop a running upgrade re-solve at the time bound - #102

Merged
jonyoder merged 3 commits into
mainfrom
upgrade-child-deadline
Nov 14, 2026
Merged

jonyoder merged 3 commits into
mainfrom
upgrade-child-deadline

Conversation

@jonyoder

Copy link
Copy Markdown
Collaborator

With UpgradeTimeFactor or UpgradeMaxTime set, each UpgradeRoots re-solve now runs under a child context that ends at the pass's bound. Before, the bound was checked only before a re-solve, so one in flight could overrun it by a whole solve (on PPM's s2-105 list, that set the pass's floor at ~1.4x the base solve). For rstudio/package-manager#22598.


  • Child deadline = time the pass has left (limit - (now - passStart)). No new option.
  • A re-solve cut by that deadline counts as no gain and ends the pass; the best answer so far comes back, no error. Parent vs child is told apart by checking the parent ctx, not the error.
  • A parent cancel or deadline behaves as before. With no bound set, no child context is made: same code path as today.
  • Docs on both fields and CHANGELOG (Unreleased, Changed) updated.

Tests (resolver/upgrade_cut_test.go): an index wrapper that stalls reads under a deadline until the ctx ends (5s fail-safe), so a "slow" re-solve costs ~100ms real time. Covers: running re-solve cut, base returned, no further re-solve; cut after a gain keeps the gain; each re-solve's deadline equals the pass's remaining time (fake clock: 25s/15s/5s at factor 2.5); parent deadline unchanged with and without a bound; no bound adds no deadline; repeated runs identical.

RED on main: the 4 cut/deadline tests failed (upgraded answer after 3 re-solves, no deadline on re-solves); the parent and no-bound tests passed, as they should. GREEN after the fix.

Checked: go test -race ./... pass; vet, gofmt, golangci-lint clean. packse 147 = 94/2/6/4/41, SAT oracle 102 with 8 disagreements, ecosystem 165 pins, transcript unchanged (no testdata changed).

Merged origin/main (v0.24.0 release); the auto-merge put the entry in the tagged 0.24.0 section, moved back to Unreleased in 86c98cf.

RoboRev: job 5262 (66782db) and job 5263 (86c98cf), both pass with no findings.

Independence audit (audit.sh --paths '%go-pyresolver-worktrees/upgrade-child-deadline%', after agentsview sync): PASS, exit 0. 1 authoring session, 241 in the lineage, no known reference retrieved. Cross-repo note: 2 curl downloads of the uv release binary by a dogfood session in the lineage (a binary, not source).

🤖 Generated with Claude Code

jonyoder and others added 3 commits November 13, 2026 22:31
…nager#22598)

With UpgradeTimeFactor or UpgradeMaxTime set, each re-solve runs under a child
context ending at the pass's bound. A re-solve cut there counts as no gain and
ends the pass. A parent cancel or deadline behaves as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonyoder
jonyoder merged commit 15c0874 into main Nov 14, 2026
2 checks passed
@jonyoder
jonyoder deleted the upgrade-child-deadline branch November 14, 2026 03:53
@jonyoder jonyoder mentioned this pull request Nov 14, 2026
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.

1 participant