{"id":1515,"date":"2026-11-23T18:00:00","date_gmt":"2026-11-23T18:00:00","guid":{"rendered":"https:\/\/wade.one\/blog\/?p=1515"},"modified":"2026-11-23T18:00:00","modified_gmt":"2026-11-23T18:00:00","slug":"graceful-shutdown-is-part-of-a-successful-deployment","status":"publish","type":"post","link":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/","title":{"rendered":"Graceful Shutdown Is Part of a Successful Deployment"},"content":{"rendered":"<p>A deployment can start every new instance successfully and still interrupt users when the old ones disappear. There may be a request halfway through, a worker holding a message or a transaction waiting to commit. The startup path gets plenty of attention. I want the shutdown path to have an equally deliberate answer for the work already in progress.<\/p>\n<p>The <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/pod-lifecycle\/#pod-termination\">Kubernetes termination lifecycle<\/a> gives containers a grace period, then forcibly stops anything still running after it expires. That is a deadline for the application to handle, not a guarantee that its work will finish. The server needs to receive the stop signal, begin draining and exit within the time available. Check that the way the container starts actually delivers that signal to the application.<\/p>\n<p>For an HTTP service, I would stop accepting new work as part of the platform&#8217;s traffic-draining process and give existing requests a bounded chance to complete. Removing an instance from routing and finishing its current connections are related steps, but they do not happen everywhere at precisely the same instant. Workers need their own decision: stop taking messages, finish what can finish and leave unfinished work available for safe redelivery. Acknowledging it just because the process is shutting down can lose the job.<\/p>\n<p>Test this during a real local or staging rollout with a deliberately slow request and an in-progress worker operation. Watch the client result, the stored outcome and whether a redelivered message repeats a side effect. Shutdown will never replace recovery from a crash, so the forced-stop case still matters. A useful deployment test shows both that ordinary draining works and that unfinished work has a sensible recovery path when time runs out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting the replacement instance is only part of a rollout. The old process still needs to stop without abandoning work.<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13],"tags":[61,341,327],"class_list":["post-1515","post","type-post","status-publish","format-standard","hentry","category-programming","tag-deployments","tag-graceful-shutdown","tag-kubernetes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Graceful Shutdown Is Part of a Successful Deployment - wade.one<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Graceful Shutdown Is Part of a Successful Deployment - wade.one\" \/>\n<meta property=\"og:description\" content=\"Starting the replacement instance is only part of a rollout. The old process still needs to stop without abandoning work.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/\" \/>\n<meta property=\"og:site_name\" content=\"wade.one\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-23T18:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wade.one\/blog\/wp-content\/uploads\/2015\/02\/Wade-Logo-cropped.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1518\" \/>\n\t<meta property=\"og:image:height\" content=\"1506\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wadewomersley\" \/>\n<meta name=\"twitter:site\" content=\"@wadewomersley\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Graceful Shutdown Is Part of a Successful Deployment\",\"datePublished\":\"2026-11-23T18:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/\"},\"wordCount\":288,\"publisher\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/#\\\/schema\\\/person\\\/8b4739f8f8bb2cff5d792d4b8779fcc3\"},\"keywords\":[\"deployments\",\"graceful-shutdown\",\"kubernetes\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/\",\"url\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/\",\"name\":\"Graceful Shutdown Is Part of a Successful Deployment - wade.one\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/#website\"},\"datePublished\":\"2026-11-23T18:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/2026\\\/11\\\/23\\\/graceful-shutdown-is-part-of-a-successful-deployment\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wade.one\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Graceful Shutdown Is Part of a Successful Deployment\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/wade.one\\\/blog\\\/\",\"name\":\"wade.one\",\"description\":\"wade womersley - york based software engineer\",\"publisher\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/#\\\/schema\\\/person\\\/8b4739f8f8bb2cff5d792d4b8779fcc3\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wade.one\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/#\\\/schema\\\/person\\\/8b4739f8f8bb2cff5d792d4b8779fcc3\",\"name\":\"Wade Womersley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/200px.png\",\"url\":\"https:\\\/\\\/wade.one\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/200px.png\",\"contentUrl\":\"https:\\\/\\\/wade.one\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/200px.png\",\"width\":202,\"height\":200,\"caption\":\"Wade Womersley\"},\"logo\":{\"@id\":\"https:\\\/\\\/wade.one\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/200px.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Graceful Shutdown Is Part of a Successful Deployment - wade.one","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/","og_locale":"en_GB","og_type":"article","og_title":"Graceful Shutdown Is Part of a Successful Deployment - wade.one","og_description":"Starting the replacement instance is only part of a rollout. The old process still needs to stop without abandoning work.","og_url":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/","og_site_name":"wade.one","article_published_time":"2026-11-23T18:00:00+00:00","og_image":[{"width":1518,"height":1506,"url":"https:\/\/wade.one\/blog\/wp-content\/uploads\/2015\/02\/Wade-Logo-cropped.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@wadewomersley","twitter_site":"@wadewomersley","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/#article","isPartOf":{"@id":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/"},"author":{"name":"","@id":""},"headline":"Graceful Shutdown Is Part of a Successful Deployment","datePublished":"2026-11-23T18:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/"},"wordCount":288,"publisher":{"@id":"https:\/\/wade.one\/blog\/#\/schema\/person\/8b4739f8f8bb2cff5d792d4b8779fcc3"},"keywords":["deployments","graceful-shutdown","kubernetes"],"articleSection":["Programming"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/","url":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/","name":"Graceful Shutdown Is Part of a Successful Deployment - wade.one","isPartOf":{"@id":"https:\/\/wade.one\/blog\/#website"},"datePublished":"2026-11-23T18:00:00+00:00","breadcrumb":{"@id":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wade.one\/blog\/2026\/11\/23\/graceful-shutdown-is-part-of-a-successful-deployment\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wade.one\/blog\/"},{"@type":"ListItem","position":2,"name":"Graceful Shutdown Is Part of a Successful Deployment"}]},{"@type":"WebSite","@id":"https:\/\/wade.one\/blog\/#website","url":"https:\/\/wade.one\/blog\/","name":"wade.one","description":"wade womersley - york based software engineer","publisher":{"@id":"https:\/\/wade.one\/blog\/#\/schema\/person\/8b4739f8f8bb2cff5d792d4b8779fcc3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wade.one\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/wade.one\/blog\/#\/schema\/person\/8b4739f8f8bb2cff5d792d4b8779fcc3","name":"Wade Womersley","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/wade.one\/blog\/wp-content\/uploads\/2015\/02\/200px.png","url":"https:\/\/wade.one\/blog\/wp-content\/uploads\/2015\/02\/200px.png","contentUrl":"https:\/\/wade.one\/blog\/wp-content\/uploads\/2015\/02\/200px.png","width":202,"height":200,"caption":"Wade Womersley"},"logo":{"@id":"https:\/\/wade.one\/blog\/wp-content\/uploads\/2015\/02\/200px.png"}}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1500,"url":"https:\/\/wade.one\/blog\/2026\/11\/19\/a-health-check-should-explain-whether-restarting-will-help\/","url_meta":{"origin":1515,"position":0},"title":"A Health Check Should Explain Whether Restarting Will Help","author":"","date":"November 19, 2026","format":false,"excerpt":"Readiness and liveness answer different questions. Connecting both to every dependency can make an outage harder to recover from.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/wade.one\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1375,"url":"https:\/\/wade.one\/blog\/2026\/07\/14\/github-models-is-shutting-down-on-july-30\/","url_meta":{"origin":1515,"position":1},"title":"GitHub Models Is Shutting Down on July 30","author":"","date":"July 14, 2026","format":false,"excerpt":"GitHub Models closes on July 30, with brownouts first, so this is a migration deadline rather than a product update to read later.","rel":"","context":"In &quot;Software Engineer&quot;","block_context":{"text":"Software Engineer","link":"https:\/\/wade.one\/blog\/category\/software-engineer\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1185,"url":"https:\/\/wade.one\/blog\/2026\/04\/17\/the-case-for-smaller-deployments\/","url_meta":{"origin":1515,"position":2},"title":"The Case for Smaller Deployments","author":"","date":"April 17, 2026","format":false,"excerpt":"Smaller deployments are usually easier to trust, easier to roll back, and easier to debug. Once a release starts carrying too much change, the team spends more time managing risk than shipping value.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/wade.one\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1444,"url":"https:\/\/wade.one\/blog\/2026\/10\/25\/feature-flags-need-a-removal-plan\/","url_meta":{"origin":1515,"position":3},"title":"Feature Flags Need a Removal Plan","author":"","date":"October 25, 2026","format":false,"excerpt":"A temporary feature flag is very good at becoming a permanent piece of the application.","rel":"","context":"In &quot;Software Engineer&quot;","block_context":{"text":"Software Engineer","link":"https:\/\/wade.one\/blog\/category\/software-engineer\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1439,"url":"https:\/\/wade.one\/blog\/2026\/10\/20\/database-migrations-need-to-survive-two-app-versions-at-once\/","url_meta":{"origin":1515,"position":4},"title":"Database Migrations Need to Survive Two App Versions at Once","author":"","date":"October 20, 2026","format":false,"excerpt":"A database migration can work perfectly on your development machine and still make a production deployment awkward.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/wade.one\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1440,"url":"https:\/\/wade.one\/blog\/2026\/10\/21\/hashed-asset-names-make-cdn-releases-easier-to-reason-about\/","url_meta":{"origin":1515,"position":5},"title":"Hashed Asset Names Make CDN Releases Easier to Reason About","author":"","date":"October 21, 2026","format":false,"excerpt":"Replacing app.js and hoping every cache forgets the old version is a fairly unpleasant deployment strategy.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/wade.one\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/posts\/1515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/comments?post=1515"}],"version-history":[{"count":1,"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/posts\/1515\/revisions"}],"predecessor-version":[{"id":1530,"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/posts\/1515\/revisions\/1530"}],"wp:attachment":[{"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/media?parent=1515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/categories?post=1515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wade.one\/blog\/wp-json\/wp\/v2\/tags?post=1515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}