wtf( )unctionsystem design, drawn
← all problemsContainersMedium

The batch job that never finished

A scheduled job runs every fifteen minutes. Its own work takes about forty seconds, and a log-shipping helper runs beside it in the same pod so the output reaches the log store.

The pod never reaches Completed. The job's container exited on time; the helper is still running, because a log shipper has no natural end. The schedule refuses to start a run while the previous one is still going, so every run after the first has been skipped.

Declare the helper so its lifetime ends with the work it serves.
Components — tap one, then tap a slot on the diagram
!The 09:00 run is still going at 14:00, and every run since has been skipped.

Boundaries, outermost first: Pod (one run): Job container (exits after 40s), Log shipper (has no natural end; FAILED: still running), an empty slot for the how the helper is declared Outside every boundary: Log store, Schedule (every 15 minutes; FAILED: runs skipped) Connections: Schedule controls Job container — creates the run (step 1) how the helper is declared controls Log shipper (step 2) Log shipper publishes to Log store — ships output

Log store
Job containerexits after 40s
Scheduleevery 15 minutesruns skipped
Log shipperhas no natural endstill running