~/talk

The essense of Graceful Shutdown

Talkat PyCon Italia 2025 · 2025-05-28..05-31· [devops-and-delivery]
slides:none on file

Covers how Python apps actually implement graceful shutdown: register signal handlers for SIGINT, SIGTERM, SIGHUP, cancel running asyncio tasks and stop the event loop, and close DB connections or requeue messages so transactions don’t leave partial state. Demonstrates with Docker and kubectl, notes SIGKILL cannot be caught, explains Docker STOPSIGNAL and Kubernetes default 30s terminationGracePeriodSeconds (reserve ~20% for platform), and shows why per-signal registration and testing (kubectl delete edge cases) matter.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:11What is graceful shutdown
  3. 3:22Basic Python shutdown handling
  4. 5:11Signal handlers in Python
  5. 6:40Understanding signals
  6. 8:08Improved signal handler setup
  7. 9:56Recap of signal handling
  8. 10:19Graceful shutdown in Kubernetes
  9. 13:53Why graceful shutdown matters
  10. 14:16Demo of Kubernetes pod deletion
  11. 15:24Async code graceful shutdown
  12. 16:51Handling signals in async apps
  13. 18:00Uncatchable signals
  14. 19:25Testing failure scenarios
  15. 20:08Docker stop signals
  16. 21:35Release strategies overview
  17. 22:41Conclusion and key takeaways
  18. 23:47Q&A: Critical scenarios for shutdown
  19. 25:13Q&A: Risks of ignoring shutdown
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.