Skip to content

Stop upgrade workers before destructive uninstall - #845

Merged
nick-potts merged 2 commits into
mainfrom
fix/uninstall-upgrade-workers
Sep 9, 2026
Merged

nick-potts merged 2 commits into
mainfrom
fix/uninstall-upgrade-workers

Conversation

@nick-potts

Copy link
Copy Markdown
Contributor

Uninstall could return success while a transient ployz-upgrade-*.service continued installing and recreated the daemon or its state. Follow-up to #827, addressing #827 (comment).

Stop loaded upgrade workers synchronously, claim the existing installation lock, stop the daemon, and stop any worker admitted during the first shutdown. Unit inspection, shutdown, or lock failures abort before destructive cleanup. Preserve /run/ployz/.install.lock until reboot so a concurrent installer cannot replace its inode and bypass exclusion.

Validation: Rung 1, bash scripts/test-daemon-lifecycle.sh — regression failed against the original uninstaller and passes with the fix. Covers active/late/absent workers, unit inspection failure, worker/daemon stop failure, busy installation ownership, and existing container-before-plugin shutdown and Docker retention guarantees. shellcheck scripts/uninstall.sh scripts/test-daemon-lifecycle.sh and git diff --check pass. This shell contract already runs in Fast CI and release verification; no Rust changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T10:20:38.056739Z 17d1fec 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.

@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: d8decf6a3f

ℹ️ 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/uninstall.sh Resolved
@nick-potts
nick-potts merged commit 5e99947 into main Sep 9, 2026
12 checks passed

@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: 17d1fec2da

ℹ️ 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/uninstall.sh
Comment on lines +50 to +51
chown root:root "$PLOYZ_RUN_DIR"
chmod 0750 "$PLOYZ_RUN_DIR"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve operator access when uninstall aborts

When the installation lock is busy or ployz.service fails to stop, execution exits after this changes /run/ployz from the installer-established ployz:ployz ownership to root:root with mode 0750. The surviving installation's socket remains group-owned by ployz, but ordinary operators in that group can no longer traverse the runtime directory, so all non-root CLI connections fail even though uninstall reported that it aborted before cleanup. Preserve the ployz group or restore the prior ownership on these failure paths; the new busy and daemon-stop-failure scenarios currently accept the inaccessible directory.

Useful? React with 👍 / 👎.

@nick-potts
nick-potts deleted the fix/uninstall-upgrade-workers branch September 30, 2026 15:14
nick-potts added a commit that referenced this pull request Sep 30, 2026
* Stop upgrade workers and exclude installation during uninstall

* Protect uninstall lock ownership and reject unsafe lock entries

---------

Co-authored-by: Codex <codex@codex-vm.tailcb9c5.ts.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant