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

Test failure when running with > 1 thread #420

Open
JoaoAparicio opened this issue Apr 9, 2023 · 1 comment
Open

Test failure when running with > 1 thread #420

JoaoAparicio opened this issue Apr 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JoaoAparicio
Copy link
Contributor

Found a flaky test, this one

# 126
t = Tables.partitioner(
(
(a=Arrow.toarrowvector(PooledArray([1,2,3 ])),),
(a=Arrow.toarrowvector(PooledArray([1,2,3,4])),),
(a=Arrow.toarrowvector(PooledArray([1,2,3,4,5])),),
)
)
tt = Arrow.Table(Arrow.tobuffer(t))

If you run it without threads, always passes. If you run it with -t 10 it has a significant chance of erroring.

A) Start Julia with -t 10

B) Create the environment with:

]activate --temp
add Arrow
add Tables
add PooledArrays

C) Run the test many times:

using Tables
using Arrow
using PooledArrays

for _ in 1:10000
    t = Tables.partitioner(
        (
            (a=Arrow.toarrowvector(PooledArray([1,2,3  ])),),
            (a=Arrow.toarrowvector(PooledArray([1,2,3,4])),),
            (a=Arrow.toarrowvector(PooledArray([1,2,3,4,5])),),
        )
    )
    tt = Arrow.Table(Arrow.tobuffer(t))
end

Highly likely that you'll hit this:

(jl_k3aixG) pkg> ERROR: TaskFailedException
Stacktrace:
 [1] wait
   @ ./task.jl:349 [inlined]
 [2] Arrow.Table(blobs::Vector{Arrow.ArrowBlob}; convert::Bool)
   @ Arrow ~/.julia/packages/Arrow/P0wVk/src/table.jl:386
 [3] Table
   @ ~/.julia/packages/Arrow/P0wVk/src/table.jl:295 [inlined]
 [4] Arrow.Table(input::IOBuffer, pos::Int64, len::Nothing; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Arrow ~/.julia/packages/Arrow/P0wVk/src/table.jl:290
 [5] Table
   @ ~/.julia/packages/Arrow/P0wVk/src/table.jl:290 [inlined]
 [6] Arrow.Table(input::IOBuffer)
   @ Arrow ~/.julia/packages/Arrow/P0wVk/src/table.jl:290
 [7] top-level scope
   @ ./Untitled-2:13

    nested task error: MethodError: no method matching resize!(::Arrow.DictEncoded{Int64, Int8, Arrow.Primitive{Int64, Vector{Int64}}}, ::Int64)
    
    Closest candidates are:
      resize!(::Vector, ::Integer)
       @ Base array.jl:1246
      resize!(::BitVector, ::Integer)
       @ Base bitarray.jl:814
      resize!(::SparseArrays.ReadOnly, ::Any)
       @ SparseArrays ~/julia-1.9.0-rc2/share/julia/stdlib/v1.9/SparseArrays/src/readonly.jl:33
      ...
    
    Stacktrace:
     [1] _append!(a::Arrow.DictEncoded{Int64, Int8, Arrow.Primitive{Int64, Vector{Int64}}}, #unused#::Base.HasLength, iter::Tuple{Int64})
       @ Base ./array.jl:1134
     [2] append!(a::Arrow.DictEncoded{Int64, Int8, Arrow.Primitive{Int64, Vector{Int64}}}, iter::Tuple{Int64})
       @ Base ./array.jl:1126
     [3] push!(a::Arrow.DictEncoded{Int64, Int8, Arrow.Primitive{Int64, Vector{Int64}}}, iter::Int64)
       @ Base ./array.jl:1127
     [4] push!(A::SentinelArrays.ChainedVector{Int64, Arrow.DictEncoded{Int64, Int8, Arrow.Primitive{Int64, Vector{Int64}}}}, val::Int64)
       @ SentinelArrays ~/.julia/packages/SentinelArrays/BcfVF/src/chainedvector.jl:506
     [5] append!(A::SentinelArrays.ChainedVector{Int64, Arrow.DictEncoded{Int64, Int8, Arrow.Primitive{Int64, Vector{Int64}}}}, B::Arrow.DictEncoded{Int64, Int8, SentinelArrays.ChainedVector{Int64, Arrow.Primitive{Int64, Vector{Int64}}}})
       @ SentinelArrays ~/.julia/packages/SentinelArrays/BcfVF/src/chainedvector.jl:664
     [6] (::Arrow.var"#107#113"{Vector{Any}, Arrow.Table})(i::Int64)
       @ Arrow ~/.julia/packages/Arrow/P0wVk/src/table.jl:313
     [7] foreach(f::Arrow.var"#107#113"{Vector{Any}, Arrow.Table}, itr::UnitRange{Int64})
       @ Base ./abstractarray.jl:3073
     [8] macro expansion
       @ ~/.julia/packages/Arrow/P0wVk/src/table.jl:312 [inlined]
     [9] (::Arrow.var"#104#110"{Channel{Any}, Arrow.Table})()
       @ Arrow ./threadingconstructs.jl:341

I've reproduced this in both 1.8.5 and 1.9.0-rc2, in two machines.
Machine 1:

julia> versioninfo()
Julia Version 1.9.0-rc2
Commit 72aec423c2a (2023-04-01 10:41 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 10 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

Machine 2:


julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 48 × Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake-avx512)
  Threads: 20 on 48 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
@ericphanson
Copy link
Member

That sounds like a bug that the test is catching rather than just a flaky test!

@ericphanson ericphanson added the bug Something isn't working label Apr 9, 2023
@ericphanson ericphanson changed the title Flaky test Test failure when running with > 1 thread Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants