Release Checklist¶
This checklist captures the work required before cutting a release that includes the graceful worker shutdown feature.
1. Code Hygiene / Compilation¶
- Merge the graceful-shutdown helpers into the canonical worker type to avoid
Worker redeclarederrors (seecmd/worker/worker_graceful_shutdown.goandcmd/worker/worker_server.go). - Ensure the worker struct exposes the fields referenced by the new helpers
(
logger,queue,cfg,metrics). go build ./cmd/workersucceeds without undefined-field errors.
2. Graceful Shutdown Logic¶
- Initialize
shutdownCh,activeTasks, andgracefulWaitduring worker start-up. - Confirm the heartbeat/lease helpers compile and handle queue errors gracefully
(
heartbeatLoop,releaseAllLeases). - Add tests (unit or integration) that simulate SIGINT/SIGTERM and verify leases are released or tasks complete.
3. Task Execution Flow¶
- Align
executeTaskWithLeasewith the realexecuteTasksignature so the "no value used as value" compile error disappears. - Double-check retry/metrics paths still match existing worker behavior after the new wrapper is added.
4. Server Wiring¶
- Ensure worker construction in
cmd/worker/worker_server.gowires up config, queue, metrics, and logger instances used by the shutdown logic. - Re-run worker unit tests plus any queue/lease e2e tests.
5. Validation Before Tagging¶
go test ./cmd/worker/...andmake test(or equivalent) pass locally.- Manual smoke test: start worker, queue jobs, send SIGTERM, confirm tasks finish or leases are released and the process exits cleanly.
- Update release notes describing the new shutdown capability and any config changes required (e.g., graceful timeout settings).