Skip to content

added probes for RabbitMQ with graceful shutdown#75

Open
henzigo wants to merge 1 commit intojg/redis-orderfrom
jg/rabbitmq-probes
Open

added probes for RabbitMQ with graceful shutdown#75
henzigo wants to merge 1 commit intojg/redis-orderfrom
jg/rabbitmq-probes

Conversation

@henzigo
Copy link
Copy Markdown
Member

@henzigo henzigo commented Apr 15, 2026

No description provided.

Copy link
Copy Markdown

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

Updates the RabbitMQ StatefulSet manifests to include Kubernetes health probes and a graceful shutdown hook, and refreshes scenario snapshots and upgrade notes accordingly.

Changes:

  • Add startupProbe, livenessProbe, and readinessProbe to RabbitMQ.
  • Add preStop lifecycle hook, terminationGracePeriodSeconds, and memory requests/limits for RabbitMQ.
  • Update RabbitMQ container ports and StatefulSet updateStrategy, and refresh expected YAML outputs + UPGRADE notes.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
kubernetes/deployments/rabbitmq.yaml Adds probes, graceful shutdown hook, resource memory settings, ports, and update strategy to the RabbitMQ StatefulSet template.
UPGRADE.md Documents the RabbitMQ probes/graceful shutdown change for v5.1.0.
tests/scenarios/basic-production/expected/migrate-first-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/basic-production/expected/migrate-first-deploy-with-demo-data.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/development-single-domain/expected/migrate-first-deploy-with-demo-data.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/escaping-env/expected/migrate-first-deploy-with-demo-data.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy-with-demo-data.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.
tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy.

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

lifecycle:
preStop:
exec:
command: [ "sh", "-c", "rabbitmqctl stop_app && sleep 5" ]
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

preStop uses rabbitmqctl stop_app && sleep 5, so if stop_app exits non-zero (e.g., node already stopping / CLI can't connect), the sleep won’t run and the hook won’t provide the intended drain delay. Consider making the hook resilient (e.g., run stop_app best-effort and always sleep).

Suggested change
command: [ "sh", "-c", "rabbitmqctl stop_app && sleep 5" ]
command: [ "sh", "-c", "rabbitmqctl stop_app || true; sleep 5" ]

Copilot uses AI. Check for mistakes.
exec:
command: [ "rabbitmq-diagnostics", "ping" ]
failureThreshold: 30
periodSeconds: 10
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

startupProbe doesn’t set timeoutSeconds, so it defaults to 1s; exec probes can easily exceed that under load (especially during cold start), causing unnecessary restarts. Set an explicit timeoutSeconds (typically matching liveness/readiness) to avoid flaky startups.

Suggested change
periodSeconds: 10
periodSeconds: 10
timeoutSeconds: 15

Copilot uses AI. Check for mistakes.
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.

2 participants