contrib.rdb

Remote Debugger.

Introduction

This is a remote debugger for Celery tasks running in multiprocessing pool workers. Inspired by a lost post on dzone.com.

Usage

from celery.contrib import rdb
from celery import task

@task()
def add(x, y):
    result = x + y
    rdb.set_trace()
    return result

Environment Variables

CELERY_RDB_HOST

CELERY_RDB_HOST

Hostname to bind to. Default is ‘127.0.01’ (only accessable from localhost).
CELERY_RDB_PORT

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.

Module Contents

Classes

Rdb(self,host=CELERY_RDB_HOST,port=CELERY_RDB_PORT,port_search_limit=100,port_skew=None,out=None) Remote debugger.

Functions

debugger() Return the current debugger instance, or create if none.
set_trace(frame=None) Set break-point at current location, or a specified frame.
class Rdb(host=CELERY_RDB_HOST, port=CELERY_RDB_PORT, port_search_limit=100, port_skew=None, out=None)

Remote debugger.

__init__(host=CELERY_RDB_HOST, port=CELERY_RDB_PORT, port_search_limit=100, port_skew=None, out=None)
get_avail_port(host, port, search_limit=100, skew=None)
say(m)
__enter__()
__exit__(*exc_info)
_close_session()
do_continue(arg)
do_quit(arg)
set_quit()
debugger()

Return the current debugger instance, or create if none.

set_trace(frame=None)

Set break-point at current location, or a specified frame.