Alan Abishek
← All work

Case 02

Personal project · 2026

Kill a worker mid-flight — zero jobs lost

  • 0 lost jobs
  • SKIP LOCKED
  • Chaos CI

Postgres-backed durable job queue: SKIP LOCKED workers, heartbeats, DAG fan-in/out, HMAC webhooks, and chaos CI that SIGKILLs workers mid-flight with zero loss.

Designed queue, workers, DAGs, and chaos proof

  • Python
  • FastAPI
  • PostgreSQL
  • React
  • TypeScript
View proof on GitHub
  1. 01 Hook

    If a worker dies mid-job, the work should still finish — not vanish into the void.

  2. 02 Context

    Solo systems project: FastAPI control plane, React operator console, Postgres as the broker — no Redis/RabbitMQ required.

  3. 03 Problem

    Queues fail in production when workers crash, claims race, or DAGs leave orphaned dependents. Extra brokers add ops cost most teams don't want.

  4. 04 Insight

    Transactional enqueue + FOR UPDATE SKIP LOCKED + heartbeats + a reclaimer beats a second infrastructure hop for many workloads.

  5. 05 Exploration

    Built claim loops, zombie reclaim, exponential backoff/DLQ, idempotent enqueue, batch DAG APIs, signed webhooks, Prometheus/Grafana, production fail-closed defaults.

  6. 06 Decision

    Chose Postgres as the source of truth so business writes and job inserts commit together — and proved crash safety with a chaos monkey in CI.

  7. 07 Solution

    Shipped HydraTask: API + workers + reclaimer + UI, with cancel/retry, multi-tenant keys, and a demo kit for portfolio walkthroughs.

  8. 08 Impact

    Chaos run: 10,000 jobs, 5 workers, kill every 5s — completed 10,000, dead-letter 0, lost 0. Open repo with CI badge and production checklist.

Impact

  • 0

    Lost jobs under chaos

  • 10k

    Jobs in chaos run

  • DAG

    Fan-out / fan-in

  • CI

    Chaos monkey proof