Signals, shutdown and local communication A shutdown signal during an upload The deploy looks clean until Sera checks which uploads reached storage. The supervisor saw a worker exit on time. Twelve clients saw their connections disappear before the upload completed. In a normal shutdown no upload is unfinished at exit. This release abandons twelve. Sera places three marks on one timeline: stop admitting work, finish the writes already accepted, then exit before the grace period runs out. A signal is an asynchronous notification delivered according to process dispositions and thread masks. Ordinary signals may coalesce while pending. Supervisor in context Ordinary signals are suited to waking a process or requesting shutdown. A socket or queue is more appropriate when every message has payload and ordering requirements. Signal handlers have a deliberately restricted set of safe operations. A thread can block selected signals and receive them later. Keep handlers short and hand work to ordinary control flow where normal synchronization and cleanup are available. Unix-domain sockets connect local processes using socket semantics. Their namespace, permissions and queue behavior matter when a sidecar is reachable from one process but not another. A named pipe provides a filesystem name for a byte stream. Its lifetime as a name differs from the data in the active pipe. Readers and writers can block. An upload consists of receiving bytes, finishing a temporary object, recording the final name, and replying. A termination signal can arrive between any two of these. Define the durable boundary where a retry may safely resume. If the reply is lost after the final name is recorded, a retried request must be able to recognize the earlier result. Wake the loop without abandoning work A peer requests shutdown or a kernel event generates a notification. A blocked signal can remain pending until an eligible thread can take delivery. Thread masks affect delivery. Ordinary duplicate pending signals may coalesce. A handler wakes the main loop. Ordinary application code stops admissions and drains outstanding work. A local message socket lets the receiver see a message, but receipt alone does not prove that work triggered by the message completed. Decide who acknowledges the final result when a shutdown begins. For example, an uploader may acknowledge only after the completed file is registered. If the shutdown cuts off the reply, a later caller needs an operation identifier to learn that the work succeeded once. Read the measurements When termination begins, stop taking new work, notify the event loop, then use the remaining grace period for accepted requests. A signal handler has strict limits on which operations it can safely perform. Use it to request a controlled shutdown, leaving ordinary cleanup to the normal execution path. For a canary, record the number of accepted uploads, completed uploads, resumable uploads and permanently lost uploads. A server may send a successful status before durable state is visible elsewhere. Probe the resulting object from the client's perspective so that a faster shutdown cannot hide broken promises. Budget the drain If one client stops sending bytes, should the worker wait forever to produce a perfect drain count? Use a bounded drain deadline. A shutdown notification can wake the main loop, which owns the operation state and can stop admission. For genuinely unfinished work, stable identifiers let a retry be reconciled. If the queue drained and acknowledgments persisted before exit, examine downstream persistence or the client’s retry boundary. Check the competing explanation Shared memory avoids copying large payloads between cooperating processes. It does not define who owns each record or when writes become visible. Add an explicit synchronization protocol. Message queues preserve message boundaries and impose capacity limits. When a receiver stops draining, the sender must have a defined blocking, rejection or retry policy. Signalfd lets an event loop read selected pending signals through a descriptor. Eventfd provides a counter-based notification often used to wake a loop from another thread. Prove the upload really finished With admission closed before draining, the same test ends with zero unfinished uploads. the termination signal requests orderly termination and may be handled. the kill signal cannot be handled. SIGSEGV indicates an invalid memory access or related protection error and warrants crash investigation. Sera checks both client acknowledgment and durable completion. A timely process exit measures the supervisor's contract, not the customer's entire upload. Apply the diagnosis Try a small upload and a large upload during a controlled rollout. Compare the grace period with the time each needs to drain. If the large one cannot finish, tests should prove cleanup or resumability on an abrupt exit. A cheerful shutdown log cannot establish whether the user can retrieve the finished object.