Skip to content

K2GO-593 fix(install): Cancel stops the module install and its download - #821

Merged
luisguzman-adfa merged 6 commits into
mainfrom
feat/K2GO-593-module-install-progress
Nov 23, 2026
Merged

luisguzman-adfa merged 6 commits into
mainfrom
feat/K2GO-593-module-install-progress

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What changes

  • Cancel of a module install sends SIGKILL to the install proot (by pid), so the kernel ends all its box processes (PTRACE_O_EXITKILL, K2GO-544). Before, SIGTERM left proot and Ansible running, and a canceled Forgejo download continued to the end.
  • The revert step removes the Ansible task dirs, so a canceled download leaves no partial file. The module command first runs dpkg --configure -a, because a kill can now stop dpkg.
  • The queue records the user cancel. A canceled module shows "Canceled", not "Couldn't install", and gets no failure notification. Retry works as before.
  • The setup screen header says "The install stopped. Check each module below." when the batch ends with a failed or canceled module (it said "Modules are currently being installed").
  • The Forgejo seed row hides when the Forgejo role failed or was canceled.

Why

The user tapped "Stop install" and the download continued in the background (K2GO-593). On Android, Process.destroyForcibly() does the same as destroy() (SIGTERM).

Steps to QA

Baseline (main): Settings > Module management > Forgejo > Install now > Install. During the program download, Cancel > Stop install. The file in /root/.ansible/tmp continues to grow.
Change: the same steps. In 4 s no Ansible process is left (ps -A | grep ansible), the partial is removed, the row says "Canceled", the header says the install stopped. Retry installs Forgejo. Check light and dark.

Verifications

  • Evidence before and after is in the Jira ticket (OnePlus 7T baseline, Samsung A16 after).
  • Unit tests: ModuleQueueStateTest (new), SetupUiStateTest (updated).
  • Deferred: progress bar, speed and time left (Scope A to C of K2GO-593, next PRs).

Notes

  • killProcess() (SIGTERM) is unchanged for the server and the reconciler.
  • On a kernel without PTRACE_O_EXITKILL (Android 7 emulator only) the box processes can outlive the kill.

UI changes

  • New: "Canceled" (module status after a user cancel).
  • Changed header on a stopped batch: "Modules are currently being installed. Please wait..." -> "The install stopped. Check each module below."
  • Both strings are in all 33 locales (machine translation, pending human review).
  • Light and dark verified on the Samsung A16.

Cancel sent SIGTERM, proot stayed up and Ansible kept downloading. Now the
runrole proot gets SIGKILL by pid, so the kernel ends all its processes. The
revert removes the partial Ansible files, and the queue records the cancel.
…ll says so

The module list, the setup screen and the module screen show "Canceled" for a
user stop. The header says the install stopped, and the seed row hides when
Forgejo did not install. Two new strings in all locales.
@luisguzman-adfa luisguzman-adfa added the ui change or edit to UI label Nov 22, 2026
Retry started the install directly and downloaded on mobile data with no
question. It now asks the same question as "Install now".
@luisguzman-adfa
luisguzman-adfa merged commit cd847c8 into main Nov 23, 2026
4 checks passed
Kill only a proot that still runs (an ended command's pid can be reused).
dpkg recovery does not wait on a conffile prompt. A cancel during pdsm stop
cancels the first module, and a real failure still notifies.
With Keep offline, "Allow only this time" on Retry now counts for the run,
as on the start path, so the module download does not ask a second time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui change or edit to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant