celery.contrib.rdb

Remote debugger for Celery tasks running in multiprocessing pool workers. Inspired by http://snippets.dzone.com/posts/show/7248

Usage

  1. from celery.contrib import rdb
  2. from celery import task
  3. @task()
  4. def add(x, y):
  5. result = x + y
  6. rdb.set_trace()
  7. return result

Environment Variables

CELERY_RDB_HOST

Hostname to bind to. Default is ‘127.0.01’, which means the socket will only be accessible from the local host.

CELERY_RDB_PORT

Base port to bind to. Default is 6899. The debugger will try to find an available port starting from the base port. The selected port will be logged by the worker.

celery.contrib.rdb.set_trace(frame=None)[源代码]

Set breakpoint at current location, or a specified frame

celery.contrib.rdb.debugger()[源代码]

Return the current debugger instance (if any), or creates a new one.

class celery.contrib.rdb.Rdb(host=’127.0.0.1’, port=6899, port_search_limit=100, port_skew=0, out=<open file ‘<stdout>’, mode ‘w’ at 0x40482078>)[源代码]