Skip to content

Conversation

Copy link

Copilot AI commented Jan 7, 2026

The grow-ssd service used an unconditional trap that disabled the service even when partition growth failed, preventing automatic retry on reboot.

Changes

  • Removed unconditional trap - Deleted trap 'sv down ...' 0 that executed on any exit
  • Added explicit disable on success - Call sv down only after:
    • Successful completion of growpart + resize2fs
    • Intentional no-op exits (device not found, no partition, no growth needed)
  • Enable retry on failure - If growpart/resize2fs fail, service remains enabled due to set -e exiting before sv down

Example

Before:

trap 'sv down /var/service/grow-ssd >/dev/null 2>&1 || true' 0  # Always disables
growpart "$DISK" "$PART"  # Failure still triggers trap

After:

growpart "$DISK" "$PART"  # Failure exits here, service stays enabled
resize2fs "$SSD_DEV"
sv down /var/service/grow-ssd >/dev/null 2>&1 || true  # Only reached on success

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

- Remove unconditional trap that disabled service on any exit
- Add sv down before each successful no-op exit
- Add sv down after successful completion of growpart/resize2fs
- Ensures service remains enabled if growth operations fail
- Allows automatic retry on reboot when failures occur

Co-authored-by: kristapsk <[email protected]>
Copilot AI changed the title [WIP] Update to address feedback on SSD partition growth Fix service disable mechanism to allow retry on failure Jan 7, 2026
Copilot AI requested a review from kristapsk January 7, 2026 22:36
@kristapsk kristapsk marked this pull request as ready for review January 7, 2026 22:40
@kristapsk kristapsk merged commit c78bcab into grow-ssd Jan 7, 2026
3 checks passed
@kristapsk kristapsk deleted the copilot/sub-pr-44-another-one branch January 7, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants