You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of a MultiThreadedExecutor is such that if you create a task and an exception happens within it, the executor will re-raise the exception regardless of whether the use retrieved it.
What this means is that node.create_task(callable) isn't very usable at the moment, since if your callable happens to raise an exception and you catch it, it doesn't matter- the executor will raise it again and crash your node.
Hmm, there's a few race conditions with my approach as I see it right now (the future could finish quickly, and immediately re-raise the exception before a user has a chance to check it).
I'm not sure what to do here. How can one create tasks if they can't also use a Future's exception-holding capabilities?
The current implementation of a MultiThreadedExecutor is such that if you create a task and an exception happens within it, the executor will re-raise the exception regardless of whether the use retrieved it.
What this means is that
node.create_task(callable)
isn't very usable at the moment, since if your callable happens to raise an exception and you catch it, it doesn't matter- the executor will raise it again and crash your node.Here's what would be nice:
At the moment, this will fail, regardless of whether you call
result()
orexception
on the future.Here's what I would suggest:
This would allow users to create tasks, handle errors, and so on. If they don't handle the error, only then will the executor raise the exception.
I'd love to hear folks thoughts on this!
The text was updated successfully, but these errors were encountered: