Repository navigation
🐛 fix(seed): wait for workers before cleanup - #3644
Merged
Merged
Conversation
gaborbernat
marked this pull request as draft
November 20, 2026 06:33
gaborbernat
force-pushed
the
fix/interrupt-seed-cleanup
branch
3 times, most recently
from
November 20, 2026 08:34
d4225f9 to
654a40e
Compare
An interrupt during seeding could close temporary app-data while a worker was still writing to it. Keep the session open until every worker finishes, including after repeated interrupts. Fixes pypa#3636
gaborbernat
force-pushed
the
fix/interrupt-seed-cleanup
branch
from
November 20, 2026 09:09
654a40e to
05a4638
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 09:49
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.
Before this fix,
FromAppData.run()joined seed threads only on the normal path. An interrupt could reach session cleanup while a worker was using temporary app-data, leaving a folder after virtualenv exited. The seeder now waits for its workers before cleanup and then re-raises the interrupt. Fixes #3636.Worker lifetime during interruption
Both wheel lookup and image installation run in an executor. Each worker records completion after its task returns. If an interrupt arrives while a task is being submitted, the seeder retries that task with a guard that runs it once, then waits for its completion. Repeated interrupts during the wait cannot release app-data while a task is active. If the executor rejects a submission, the task runs on the caller thread.
sequenceDiagram participant S as Session participant W as Seed worker participant A as Temporary app-data rect rgb(255, 214, 214) S->>+W: before: start seed work S-->>S: interrupt S->>A: remove app-data W-->>-S: work finishes later end rect rgb(216, 243, 220) S->>+W: now: start seed work S-->>S: interrupt S->>W: wait for task completion W-->>-S: work finishes S->>A: remove app-data endBehavior changes
When temporary app-data is in use, an interrupt during seed lookup or installation waits for active workers before the session removes that directory. The temporary-cache copy guard continues to select copies instead of symlinks.
Reported by @oss-scanner:
ANT-2026-02O7K288.