Skip to content

[app] Graceful shutdown consistency (grace periods and preStop alignment) #36

Description

@henzigo

Context

Grace periods and preStop hooks are inconsistent across workloads:

Container Grace preStop Issue
php-fpm 120 s sleep 10; kill -QUIT 1 grace longer than needed (10 s drain + 60 s request_terminate_timeout)
nginx 120 s sleep 5 && nginx -s quit drains 5 s while php-fpm drains 10 s — nginx stops accepting before FPM
storefront 60 s sleep 10 Node exits in seconds; ~47 s wasted on every rollout
redis 30 s (default) none no explicit shutdown; 2 GB in-memory store

Proposal

Align (all as component values, these become the defaults):

  • php-fpm grace 90 (10 drain + 60 worker timeout + buffer)
  • nginx preStop sleep 10 && nginx -s quit (same LB-drain window as php-fpm)
  • storefront grace 30
  • redis grace 60 + preStop redis-cli SHUTDOWN NOSAVE (ephemeral cache — NOSAVE)

Cron and RabbitMQ are handled in #25 and #6 respectively — keep this issue to the four above.

Tasks

  • Defaults update + values plumbing where missing (redis preStop/grace)
  • Unit tests, golden snapshots, deviations entry
  • Rollout observation on a dev cluster (no 5xx during rollout, faster drains)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/app-chartshopsys-app chart (workloads, ingresses, secrets, hooks)area/infra-chartshopsys-infra chart (Redis, RabbitMQ, RBAC)behavior-changechanges rendered manifests - regenerate golden snapshots + update deviations docenhancementNew feature or requestpriority/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions