Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should @sync unwrap TaskFailedExceptions when constructing CompositeException? #41301

Closed
oxinabox opened this issue Jun 21, 2021 · 2 comments
Closed
Labels
domain:error handling Handling of exceptions by Julia or the user

Comments

@oxinabox
Copy link
Contributor

Right now we take any exception that occurs in a @sync block and just put it straight into a Composite exception

julia/base/task.jl

Lines 359 to 363 in b46df09

catch e
if !@isdefined(c_ex)
c_ex = CompositeException()
end
push!(c_ex, e)

However large parts of @sync blocks are in turn @async statements, and any exception thrown from a @async statement will be a TaskFailedException.

There is a case to be made for unwrapping them.
(Arguably the same for CapturedExceptions with distributed)
Upside of unwrapping them is that this is probably what people want, it is the useful information.
Downside is it is a loss of information, someone might want the task.

I lean towards not doing this, and just doing #41300
at least at first, which should solve most of the pain.

@JeffBezanson
Copy link
Sponsor Member

Downside is it is a loss of information, someone might want the task.

Yes, this loses a lot of information, I don't think we should do it.

@JeffBezanson JeffBezanson added the domain:error handling Handling of exceptions by Julia or the user label Jun 22, 2021
@nalimilan
Copy link
Member

See also #38931.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

3 participants