facebookarchive / sparts

Prototype python services with as little code as possible
Other
296 stars 44 forks source link

QueuTask: prevent unhandled exception from tearing the main loop down #108

Closed djipko closed 8 years ago

djipko commented 8 years ago

Prior to this patch - raising an exception inside an execute() of a queued task when using futures instead of deferreds, would tear down the whole service thread. This is almost certainly not what we want.

The cleanest way to fix this seems to be in the ExecutionContext, where we consider an exception handled if it's set on a future, and let the submitter worry about it.

fmoo commented 8 years ago

So, there's no guarantee that the person who created the future is going to wait for the result, but I think this is the right tradeoff in behavior.