startover / pythonfutures

Automatically exported from code.google.com/p/pythonfutures
Other
0 stars 0 forks source link

Tracebacks lost when exception is thrown in worker #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When an exception is thrown in a thread or subprocess the exception is 
captured, but not the traceback - this can make it difficult to see where an 
error is coming from, as the exception is simply re-raised in result() or 
returned from exception()

This patch adds a traceback attribute to the thrown exception with a string 
serialized version of the stacktrace.

Original issue reported on code.google.com by br...@rdnzl.net on 5 Feb 2014 at 10:50

Attachments:

GoogleCodeExporter commented 9 years ago
Ping?

Original comment by br...@rdnzl.net on 27 Feb 2014 at 2:07

GoogleCodeExporter commented 9 years ago
If you are interested here's also a workaround which not requires to patch the 
library:
http://stackoverflow.com/questions/19309514/how-to-get-correct-line-number-where
-exception-was-thrown-using-concurrent-futur/24457608#24457608

Original comment by loumarvi...@gmail.com on 9 Jul 2014 at 8:01

GoogleCodeExporter commented 9 years ago
Yeah, that's what I ended up doing in production, but it would be nice to have 
the library handle this - it's pretty obscure for a first-time user of the 
futures library.

Original comment by br...@rdnzl.net on 14 Jul 2014 at 7:00

GoogleCodeExporter commented 9 years ago
I made a fix independently and released a new version (2.2.0) to address this 
issue for ThreadPoolExecutor. AFAIK there is no way to serialize tracebacks so 
the problem remains for ProcessPoolExecutor.

Original comment by alex.gro...@nextday.fi on 26 Sep 2014 at 7:18