Skip to content

Threads fail silently on error #153

@efaulhaber

Description

@efaulhaber

MWE:

julia> x = zeros(Int, 5, 10)
5×10 Matrix{Int64}:
 0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0

julia> @batch for j in axes(x, 2)
           for i in 1:5
               if i > 3 && j in (2, 4, 9)
                   error("some error")
               end
               x[i, j] = 1
           end
       end

julia> x
5×10 Matrix{Int64}:
 1  1  1  1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1  1  1
 1  0  1  0  1  1  1  1  0  1
 1  0  1  0  1  1  1  1  0  1

I want to update the columns of x and run into an error. Instead of showing the error, the relevant threads just stop silently.
In an actual code, I might want to update some object, which failed for some reason. But Polyester.jl doesn't tell me it failed, so I might continue with this broken x, not realizing it is in an invalid (incompletely updated) state, causing unpredicted behavior down the road.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions