Repository navigation
Stop a solve when its context ends - #96
Merged
Merged
Conversation
Adopt go-pubgrub v0.6.0 and set Solver.Interrupt to ctx.Err. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps go-pubgrub to v0.6.0 and sets
Solver.Interrupt = ctx.ErrwhereresolveOncebuilds each solver, so a solve stops when its context is cancelled or times out (rstudio/package-manager#22613). The error comes back unwrapped byexplain, soerrors.Is(err, context.DeadlineExceeded),context.Canceledandsolver.ErrInterruptedall match fromresolver.Resolve.Where the solver is built
resolver.resolveOnceis the onlysolver.Newcall outside tests. It covers the first solve, everyYankExemptTransitivePinsre-solve in its loop, and everyUpgradeRootsre-solve (upgradeRootscallsresolveOnce). A cancel during theUpgradeRootspass still returns the first answer with no error, as before; the re-solve now stops right away.Tests
New
resolver/interrupt_test.go, with an index that ignores the context so only the solver's check can see a cancel:Resolvereturns at once,errors.IsmatchesDeadlineExceededandErrInterrupted, not aResolutionErrorerrors.Is(err, context.Canceled)UpgradeRootsre-solve starts: that re-solve makes no decision past the root; base answer returnedAll three fail with the
Interruptline removed.go test ./...passes; vet and gofmt clean.Independence audit
PASS: no retrieval of a known reference implementation in 222 session(s).(afteragentsview sync,--pathson this worktree and this session's scratchpad). It also lists the same 2 cross-repo risk entries as go-pubgrub#26 (agent-a63f03d8042244b81, downloading a uv release binary on a dogfood host); not from this work.Clean-room: written from go-pyresolver and go-pubgrub code only; no uv or pubgrub-rs source read.
RoboRev job 5245 on 3435110: no findings.
🤖 Generated with Claude Code