Skip to content

fix(install): clean up downloads on top-level signals - #1376

Merged
archledger merged 5 commits into
mainfrom
fix/installer-signal-cleanup
Nov 15, 2026
Merged

archledger merged 5 commits into
mainfrom
fix/installer-signal-cleanup

Conversation

@archledger

Copy link
Copy Markdown
Owner

What & why

Dash can skip the parent installer's EXIT trap for an untrapped signal
after a verified .deb has been assigned to download_dir but before
apt-get starts. 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 ebb0c2c9489865ca5e3a9800fed38bb3ed41370e is based on 5a238e6ee08e1b0b821adea3d12e86eecb94c35f.

Testing

  • Full standard gate: guarded workspace 5,617 passed, 0 failed;
    full Clippy, feature lanes, rustdoc and release build all green.
  • bash scripts/test-install-script.sh passes under both dash and
    bash, including early HUP/INT/TERM with statuses 129/130/143, the
    private-report block and no leftover download.
  • Baseline main is RED for all three early signals (leftover
    directory and no report block); the final tree is GREEN.
  • The pre-existing during-package signal_shell case passes.
  • dash -n, bash -n, cargo +1.88.0 fmt --all --check and
    git diff --check pass.
  • Independent reviews approved the implementation and bounded
    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.

Copilot AI lite review requested due to automatic review settings November 15, 2026 04:45
@github-actions github-actions Bot added bug Confirmed or suspected incorrect behavior; use the Bug report template packaging Distro lanes: Fedora and Copr, Debian and PPA, Arch and AUR, Nix labels Nov 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T17:13:36.072058Z 4ddf94c New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread scripts/install.sh Resolved
@archledger
archledger force-pushed the fix/installer-signal-cleanup branch from ebb0c2c to f504f2b Compare November 15, 2026 11:55
Copilot AI lite review requested due to automatic review settings November 15, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
@archledger
archledger force-pushed the fix/installer-signal-cleanup branch from f504f2b to cfb886b Compare November 15, 2026 13:42
Copilot AI lite review requested due to automatic review settings November 15, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change still has critical installer race and signal-cleanup paths that can fail or delete an in-use download directory, and it also overwrites an unrelated changelog entry.

3 open issues

Review effort: Lite

Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread CHANGELOG.md Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/install.sh Resolved
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>
@archledger
archledger force-pushed the fix/installer-signal-cleanup branch from cfb886b to ee7efde Compare November 15, 2026 16:15
Copilot AI lite review requested due to automatic review settings November 15, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/install.sh Resolved
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>
Copilot AI lite review requested due to automatic review settings November 15, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because the cancellation and cleanup behavior has unresolved edge cases involving active fetch and GPG child processes.

No open issues 🎉

Review effort: Lite

@archledger
archledger merged commit cf097b8 into main Nov 15, 2026
17 checks passed
@archledger
archledger deleted the fix/installer-signal-cleanup branch November 15, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Confirmed or suspected incorrect behavior; use the Bug report template packaging Distro lanes: Fedora and Copr, Debian and PPA, Arch and AUR, Nix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants