Ticket #130 (new defect)

Opened 1 year ago

Last modified 7 months ago

problems in CopiedFailure

Reported by: warner Assigned to:
Priority: major Milestone: undecided
Component: error-handling Version: 0.4.1
Keywords: Cc:

Description

While trying to debug a remote exception (which turned out to be in remote_decref, being called on a CLID which had already gone away), I was frustrated to see that the trial output was an extremely terse [ERROR] "KeyError: 1". Asking trial for more detail (by passing it --tbformat=verbose provoked an internal trial error, no attribute ".count" while trying to do printTraceback.

There are several overlapping problems:

  • Twisted's Failure object has acquired some new attributes in recent versions. In particular, each Failure instance gets a unique .count attribute, assigned in the constructor, and Failure.printTraceback will include it in the rendered traceback if tbformat==verbose. Foolscap was not sending a copy of .count over the wire.
  • the receiving process is getting an actual Failure instance, rather than a CopiedFailure instance. In particular, Failure.printTraceback is being called instead of CopiedFailure.printTraceback, so the lack of .count is more troublesome. I don't understand why this could be the case. I think what we do is instantiate a CopiedFailure and then set its __dict__ to the deserialized attribute dictionary. Perhaps that __dict__ set also manages to set __class__ and thus changes the method lookup behavior. But __class__ isn't supposed to be part of the attribute dictionary that is sent over the wire.
  • if CopiedFailure could produce a .frames attribute that looked more like what Failure was expecting, this wouldn't be such a problem.

Attachments

send-count.diff (1.2 kB) - added by warner on 06/16/09 15:24:49.
patch to include .count attribute in CopiedFailure? dict

Change History

06/16/09 13:52:34 changed by warner

note that modifying twisted.trial.reporter.Reporter._formatFailureTraceback to print fail.traceback will display the missing debug information. CopiedFailure.printTraceback does this, but it's not getting called (instead Failure.printTraceback is called, which tries to render .frames instead of .traceback, and CopiedFailures don't have .frames).

06/16/09 15:24:49 changed by warner

  • attachment send-count.diff added.

patch to include .count attribute in CopiedFailure? dict

01/11/10 12:59:16 changed by warner

  • owner changed.
  • component changed from unknown to error-handling.