# django-q-watchdog: catch django-q tasks that were lost when a worker died, or froze

**URL:** <https://forum.djangoproject.com/t/django-q-watchdog-catch-django-q-tasks-that-were-lost-when-a-worker-died-or-froze/46165>\
**Category:** Packages\
**Created:** [October 9, 2026, 5:30am UTC](https://forum.djangoproject.com/t/django-q-watchdog-catch-django-q-tasks-that-were-lost-when-a-worker-died-or-froze/46165 "2026-10-09T05:30:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradeeppc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pradeeppc/32/33478_2.png) [@pradeeppc](https://forum.djangoproject.com/u/pradeeppc)\
**Post date:** [October 9, 2026, 5:30am UTC](https://forum.djangoproject.com/t/django-q-watchdog-catch-django-q-tasks-that-were-lost-when-a-worker-died-or-froze/46165/1 "2026-10-09T05:30:55Z")

</div>

Hi all,

I’ve released django-q-watchdog, a small add-on for django-q and django-q2.

The problem: when a django-q worker process dies mid-task (out-of-memory kill, segfault, container restart), the task disappears. There’s no Failed task and no error, only a log line saying “reincarnated worker … after death”. On django-q 1.3.x the same happens when a task hits the timeout. And a task that hangs looks exactly like one that’s working.

django-q-watchdog keeps a heartbeat for every running task and reports:

- **lost** and **timed out** tasks, by name, with the worker, memory and CPU at the time, saved into django-q’s Failed tasks
- **frozen** tasks: memory hasn’t moved for an hour, reported as waiting (no CPU, usually an external call with no timeout) or busy (possibly a loop)

A management command (`manage.py qwatchdog --fail-on-problems`) runs from cron and alerts once per problem through logging and Django signals, and there’s an optional staff-only JSON status endpoint. It works with or without django-tenants.

I built it after losing tasks in production without any trace. It’s tested on django-q 1.3.9 and django-q2 with Django 4.2 to 6.0, including runs where worker processes are killed for real.

GitHub: [GitHub - pradeeppc/django-q-watchdog: Find the django-q tasks that crashed, timed out or froze, and say which ones. · GitHub](https://github.com/pradeeppc/django-q-watchdog)  
PyPI: [Client Challenge](https://pypi.org/project/django-q-watchdog/)

Feedback is very welcome, especially from people running django-q at scale.
