diff --git a/src/operations/join_interface.jl b/src/operations/join_interface.jl index 9127cba..31c1065 100644 --- a/src/operations/join_interface.jl +++ b/src/operations/join_interface.jl @@ -158,6 +158,11 @@ function _join( process_one_chunk = (type, l, r, cmp_l, cmp_r, other_r, lookup, r_sorted, l_sorted, r_unique) -> begin + # Variables below MUST be `local`: identifiers `inner_l`, `inner_r`, `outer_l` + # are also assigned in the enclosing `_join` body, so Julia's soft-scope rules + # would otherwise capture them by reference. Multiple `Dagger.@spawn`ed + # invocations of this closure would then race on the same binding cells. + local inner_l, inner_r, outer_l inner_l, inner_r = match_inner_indices( l, r, cmp_l, cmp_r, lookup, r_sorted, l_sorted, r_unique ) diff --git a/test/table.jl b/test/table.jl index bc05262..a337183 100644 --- a/test/table.jl +++ b/test/table.jl @@ -532,7 +532,7 @@ using OnlineStats @test isequal(lj1u, lj7) @test isequal(lj1, lj8) @test isequal(lj1, lj9) - # @test isequal(lj1, lj10) + @test isequal(lj1, lj10) ij1 = innerjoin(d1, d2, on=on) ij1u = innerjoin(d1, unique(d2, r_colsymbols), on=on) @@ -557,7 +557,7 @@ using OnlineStats @test isequal(ij1u, ij7) @test isequal(ij1, ij8) @test isequal(ij1, ij9) - # @test isequal(ij1, ij10) + @test isequal(ij1, ij10) @test isequal(ij1, ij11) end end