Repository navigation
fix(install): clean up downloads on top-level signals - #1376
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active finding remains in scripts/install.sh because signal-handling transitions can leave pkg_dir behind, and the added regression does not cover the identified boundary windows.
1 open issue
What changed in this PR
This PR improves release-installer cleanup when HUP, INT, or TERM arrives after a verified package is downloaded but before package installation begins, while preserving package-manager signal behavior.
Changes:
- Adds top-level signal traps and restores default dispositions around package-manager execution.
- Adds regression coverage for early signals in the install-script harness.
- Documents the cleanup behavior and its scope in the changelog.
A remaining moderate issue is that signal race windows exist immediately before package execution and immediately after it returns, and the current regressions do not cover those transitions.
| File | Description |
|---|---|
| scripts/test-install-script.sh | Adds HUP, INT, and TERM regression scenarios for signals delivered before package-manager execution. |
| scripts/install.sh | Adds signal-aware cleanup and manages signal dispositions around verified package installation. |
| CHANGELOG.md | Documents the pre-install download cleanup behavior and package-manager signal handling. |
Review effort: Lite
ebb0c2c to
f504f2b
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer validation is needed because shell-specific signal handling, asynchronous-job cleanup, and timing-sensitive destructive cleanup races across dash and bash are operationally consequential.
No open issues 🎉
1 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f504f2b169
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f504f2b to
cfb886b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfb886be7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Dash can skip the parent's EXIT trap for an untrapped signal after a verified .deb has been assigned to download_dir but before apt-get starts. Keep that package directory from being left behind. - Route HUP, INT and TERM through on_exit outside package execution. - Restore default dispositions only while the package manager runs, so dash cannot hold the shell open until apt finishes. - Cover all three early signals with status, reporting and no-download assertions and add a bounded CHANGELOG entry. Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
Closing the early download-cleanup window left two boundaries where a signal could leave the verified package directory behind, or remove it while a newly launched package manager still needed it. - Run the package manager as an asynchronous direct child and preserve its inherited signal behavior with GNU env's default-signal reset. - Decide exit cleanup from the parent's current job state, without PID liveness, procfs, CHLD handlers, or delayed ownership flags. - Exercise signals at every handoff boundary, child SIGINT, ordinary package failures and directory recreation under dash and bash. Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
Asynchronous package execution could read EOF instead of a conffile response, and a signal aimed only at the installer could leave download work running after its parent exited. - Preserve caller stdin before launching the direct package child. - Own each verified download directory before starting its worker. - Publish child completion before normal reaping and cancel only a currently running or stopped job, preserving unclear states safely. - Keep one worker PID for fetch traps and handle dash and Bash job report layouts, with coverage for active and post-wait signals. Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
Treat failed job queries as unknown and reap download workers without replacing their recorded keep-disposition statuses. Cover query-only failures and signed nested completion records under Dash and Bash. Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
cfb886b to
ee7efde
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Nested shell jobs, traps, completion markers, and package-manager ownership introduce timing-sensitive dash/bash lifecycle races that require maintainer validation on supported systems.
No open issues 🎉
3 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee7efded72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Publish completion and job-state records inside the private temporary download directory rather than shared-directory siblings. Preserve verified downloads through publication and reaping, and do not construct a completion path if temporary directory creation fails. Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>



What & why
Dash can skip the parent installer's EXIT trap for an untrapped signal
after a verified
.debhas been assigned todownload_dirbut beforeapt-getstarts. That leaves the verified package directory behind.Route HUP, INT and TERM through the existing cleanup outside package
execution. Restore default dispositions only while the package manager
runs, preserving its established immediate signal behavior and the
verified package for it to read. Add early-signal regressions and a
bounded changelog entry.
Candidate
ebb0c2c9489865ca5e3a9800fed38bb3ed41370eis based on5a238e6ee08e1b0b821adea3d12e86eecb94c35f.Testing
full Clippy, feature lanes, rustdoc and release build all green.
bash scripts/test-install-script.shpasses under both dash andbash, including early HUP/INT/TERM with statuses 129/130/143, the
private-report block and no leftover download.
directory and no report block); the final tree is GREEN.
signal_shellcase passes.dash -n,bash -n,cargo +1.88.0 fmt --all --checkandgit diff --checkpass.changelog wording.
The demonstrated guarantee is the owned-directory pre-install signal
window. It is not a claim of atomic cleanup at every ownership
transition or while a package manager may still read the file. All
harness runs used stand-ins and a local Debian image with
network=none; no real installation or package-manager invocation.