send_robust should include traceback in response when Exception occurs
|Reported by:||Jim Dalton||Owned by:||Unai Zalakain|
|Cc:||Jim Dalton, unai@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have cron job that runs a task which sends a signal via
send_robust. I ran into a wall recently in trying to configure better logging for this job. The basic problem is that I can't access the traceback for any exception that occurred in a receiver, which makes debugging in my situation something of a nightmare.
As it stands now, if an exception occurs in a receiver when a
send_robust signal is sent, a tuple is added to the responses list which contains the receiver function and the exception.
I would like to propose that we include the traceback as a third item in the tuple. With the exception and traceback, it is possible to construct the
(type, value, traceback) returned by
sys.exc_info() (and used by the Python logging module), so that exceptions in receiver functions can be more effectively debugged.
A patch will require no more than a line or two in production and test code and probably a minor documentation tweak.
I will submit a patch for this shortly, unless anybody presents any objections or concerns.
Change History (23)
comment:2 follow-up: 3 Changed 6 years ago by
|Triage Stage:||Unreviewed → Design decision needed|
comment:15 Changed 3 years ago by
|Owner:||changed from nobody to Unai Zalakain|
|Status:||new → assigned|