Menu

Who Kills Your Background Worker, and How Soon? A Shutdown Test Plan
📰

Who Kills Your Background Worker, and How Soon? A Shutdown Test Plan

DEV Community: python·Taylor Wang·7 days ago
#vpuiEyIM
#devtopython#devto#dev#process#signal
Reading 0:00
15s threshold

Most teams spend their testing budget on the first second of a process and almost none on the last one. That asymmetry is expensive, because a worker that starts cleanly but gets killed mid-write can leave a half-applied batch, duplicated side effects, or a queue item that looks in-flight forever. The plan below is about measuring the shutdown path you already have: which signal arrives, how long the platform waits, and what your process leaves behind when the window closes early.

To be explicit about the evidence: everything here is an illustrative testing procedure , not a report of an experiment. Any number you end up with comes from your own platform and your own workload, so treat the values below as placeholders you must replace.

What actually happens when a platform stops your process

Shutdown usually has two phases: a polite request ( SIGTERM ), then an unblockable one ( SIGKILL ) after some interval. The interval is a platform policy, and it is rarely the value people assume it is.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.