---
title: "Comment by Rishabh Mishra on \"I Kill My Workers on Purpose\" | Hashnode"
description: "The SIGKILL test is the honest proof here, since a clean shutdown never shows the real failure mode. One detail I would watch is the lease length: too short and"
url: "https://hashnode.com/posts/crash-safe-workflow-engine-postgres/6afcf385577ca6d1f890dc51/comment/6afd146254af94234163cfcd"
---

[Discussion](https://hashnode.com/posts/crash-safe-workflow-engine-postgres/6afcf385577ca6d1f890dc51)

Comment [I Kill My Workers on Purpose](https://hashnode.com/posts/crash-safe-workflow-engine-postgres/6afcf385577ca6d1f890dc51)

[Rishabh Mishra](https://hashnode.com/@rushdeploy)

[16h ago](https://hashnode.com/posts/crash-safe-workflow-engine-postgres/6afcf385577ca6d1f890dc51/comment/6afd146254af94234163cfcd)

The SIGKILL test is the honest proof here, since a clean shutdown never shows the real failure mode. One detail I would watch is the lease length: too short and a slow worker loses a job mid-step, too long and recovery waits, so I would tie it to the slowest step plus a margin.

[Jason Collins](https://hashnode.com/@jdcollins)

[8h ago](https://hashnode.com/posts/crash-safe-workflow-engine-postgres/6afcf385577ca6d1f890dc51/comment/6afd146254af94234163cfcd#reply-6afd7b1e500f562994b30c21)

Nice catch! I'd thought about slow handlers and lease length early on...then lost sight of it.

I should be able to get around the issue by having each handler declare its expected duration and workers send heartbeats to extend the lease while a long-running job is still healthy. That lets slow jobs keep their claim without forcing every lease to be long, so recovery can still happen quickly when a worker really does die.

I’ve added it to the plan. Thanks!

[Rishabh Mishra](https://hashnode.com/@rushdeploy)

[7h ago](https://hashnode.com/posts/crash-safe-workflow-engine-postgres/6afcf385577ca6d1f890dc51/comment/6afd146254af94234163cfcd#reply-6afd926f6bb10234cd829b49)

Heartbeats plus declared durations is a clean fix, since the lease can stay short for fast recovery while slow jobs keep their claim. One edge I would still test is a stalled heartbeat on a healthy handler, so a job is not reclaimed mid-step. Keen to see how it holds up in the next SIGKILL run.
