Skip to content

Conversation

@gOOvER
Copy link
Contributor

@gOOvER gOOvER commented Dec 13, 2025

restart: unless-stopped is the way to go for the Pelican Docker container. It’ll restart if it crashes or the server reboots, but it won’t bug you if you manually stopped it. Makes updates and maintenance way easier.
restart: always can be risky because the container will keep restarting even if it keeps crashing. This can create a loop and use up resources unnecessarily, especially during updates or if something goes wrong.

Copilot AI review requested due to automatic review settings December 13, 2025 07:28
@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

📝 Walkthrough

Walkthrough

The panel service restart policy in Docker Compose configurations was changed from always to unless-stopped in both compose files, modifying container restart behavior to stop restarts when compose is stopped while preserving automatic restarts on system failures.

Changes

Cohort / File(s) Summary
Panel service restart policy update
compose.yml, compose-full-stack.yml
Changed panel service restart policy from always to unless-stopped, altering container restart behavior to stop restarts when compose is stopped while maintaining automatic restarts on system failures

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately describes the main change: switching the Docker panel restart policy from always to unless-stopped.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for switching from always to unless-stopped restart policies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fdd9faa and 1c287bd.

📒 Files selected for processing (2)
  • compose-full-stack.yml (1 hunks)
  • compose.yml (1 hunks)
🔇 Additional comments (2)
compose.yml (1)

34-34: Verify the PR description accurately reflects Docker behavior.

The unless-stopped restart policy will not restart a container when the Docker daemon restarts if the container was previously in a stopped state. However, the PR description states the intent is "restart the container on crashes or server reboots but will not restart after a manual stop."

With unless-stopped, at daemon restart, the container won't be restarted if you stopped it before—which means it will NOT restart on a "server reboot" if it was manually stopped prior. This differs from the stated intent of restarting on "server reboots."

In contrast, with always, the container will restart even if it had been stopped before the reboot.

Clarify whether the intended behavior is:

  • Keep containers stopped across daemon/system reboots if manually stopped (current behavior with unless-stopped), or
  • Always restart on system reboots regardless of prior manual stop (would require always)
compose-full-stack.yml (1)

40-56: Inconsistent restart policies across related services.

In this file, the panel service uses restart: unless-stopped (line 56), while the database (line 42) and cache (line 51) services retain restart: always. Since these services are linked (lines 64–66), the panel depends on both database and cache for functionality.

With this configuration:

  • If the database or cache are manually stopped, they won't restart on a daemon restart
  • The panel also won't restart on a daemon restart if stopped
  • However, if the database/cache crash (exit with non-zero), they'll restart; if the panel crashes, it won't (without explicit restart)

This asymmetry may not align with typical infrastructure resilience patterns. Clarify whether:

  1. Database and cache should also be updated to unless-stopped for consistency, or
  2. These services have different operational requirements intentionally

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Docker restart policy for the Pelican panel service from restart: always to restart: unless-stopped across both compose files. This change provides better control during maintenance and updates by preventing automatic restarts when the container is manually stopped, while still ensuring the service restarts after crashes or system reboots.

Key Changes:

  • Updated restart policy for the panel service to unless-stopped in both Docker Compose configurations

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
compose.yml Changed panel service restart policy from always to unless-stopped
compose-full-stack.yml Changed panel service restart policy from always to unless-stopped, though database and cache services remain with restart: always

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

image: ghcr.io/pelican-dev/panel:latest
build: .
restart: always
restart: unless-stopped
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

The panel service restart policy has been updated to unless-stopped, but the database (line 42) and cache (line 51) services still use restart: always. For consistency and to apply the same benefits mentioned in the PR description (easier maintenance, avoiding restart loops during updates), consider updating all services in the stack to use unless-stopped. This would allow you to manually stop any service for maintenance without it automatically restarting.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

idk, if this is really needed, because database and cache could run without pelican

@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@m3ow-dev
Copy link
Contributor

This is the expected behaviour for all docker containers in a production environment, I second this pr.

@notAreYouScared notAreYouScared merged commit 4a1ecb1 into pelican-dev:main Dec 15, 2025
31 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants