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

Concurrency Violation Error for multiple packages with multithreading in julia 1.9 #511

Open
beorostica opened this issue May 18, 2023 · 1 comment

Comments

@beorostica
Copy link

beorostica commented May 18, 2023

When I use Blink and/or PlotlyJS packages with multiple threads in julia 1.9, a ConcurrencyViolationError appears:

C:\Users\beorostica>julia -t auto
julia> using PlotlyJS
julia> plot([1,2,3],[1,2,3])
julia> ConcurrencyViolationError("lock must be held")
....
C:\Users\beorostica>julia -t auto
julia> using Blink, Interact
julia> w = Window()
julia> ui = filepicker("test")
julia> content!(w, "body", ui)
julia> ConcurrencyViolationError("lock must be held")
....

This is the complete stracktrace:

julia> ConcurrencyViolationError("lock must be held")
Stacktrace:
  [1] concurrency_violation()
    @ Base .\condition.jl:8
  [2] assert_havelock
    @ .\condition.jl:25 [inlined]
  [3] assert_havelock
    @ .\condition.jl:48 [inlined]
  [4] assert_havelock
    @ .\condition.jl:72 [inlined]
  [5] notify(c::Condition, arg::Any, all::Bool, error::Bool)
    @ Base .\condition.jl:150
  [6] #notify#622
    @ .\condition.jl:148 [inlined]
  [7] notify (repeats 2 times)
    @ .\condition.jl:148 [inlined]
  [8] notify
    @ C:\Users\beorostica\.julia\packages\WebIO\rv35l\src\connection.jl:76 [inlined]
  [9] addconnection!
    @ C:\Users\beorostica\.julia\packages\WebIO\rv35l\src\connection.jl:52 [inlined]
 [10] dispatch_command(conn::Blink.AtomShell.WebIOBlinkComm, data::Dict{String, Any})
    @ WebIO C:\Users\beorostica\.julia\packages\WebIO\rv35l\src\messaging.jl:95
 [11] dispatch(conn::Blink.AtomShell.WebIOBlinkComm, data::Dict{String, Any})
    @ WebIO C:\Users\beorostica\.julia\packages\WebIO\rv35l\src\messaging.jl:81
 [12] (::Blink.AtomShell.var"#19#20"{Blink.AtomShell.WebIOBlinkComm})(msg::Dict{String, Any})
    @ Blink.AtomShell C:\Users\beorostica\.julia\packages\Blink\MmPP3\src\AtomShell\webio.jl:29
 [13] #invokelatest#2
    @ .\essentials.jl:816 [inlined]
 [14] invokelatest
    @ .\essentials.jl:813 [inlined]
 [15] handle_message(o::Blink.Page, m::Dict{String, Any})
    @ Blink C:\Users\beorostica\.julia\packages\Blink\MmPP3\src\rpc\callbacks.jl:7
 [16] macro expansion
    @ C:\Users\beorostica\.julia\packages\Lazy\9Xnd3\src\macros.jl:268 [inlined]
 [17] ws_handler(ws::HTTP.WebSockets.WebSocket)
    @ Blink C:\Users\beorostica\.julia\packages\Blink\MmPP3\src\content\server.jl:50
 [18] (::Mux.var"#9#10"{Mux.App})(sock::HTTP.WebSockets.WebSocket)
    @ Mux C:\Users\beorostica\.julia\packages\Mux\PipQ9\src\server.jl:48
 [19] upgrade(f::Mux.var"#9#10"{Mux.App}, http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}}; suppress_close_error::Bool, maxframesize::Int64, maxfragmentation::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ HTTP.WebSockets C:\Users\beorostica\.julia\packages\HTTP\A83Es\src\WebSockets.jl:439
 [20] upgrade
    @ C:\Users\beorostica\.julia\packages\HTTP\A83Es\src\WebSockets.jl:419 [inlined]
 [21] (::Mux.var"#14#15"{Mux.App, Mux.App})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}})
    @ Mux C:\Users\beorostica\.julia\packages\Mux\PipQ9\src\server.jl:81
 [22] #invokelatest#2
    @ .\essentials.jl:816 [inlined]
 [23] invokelatest
    @ .\essentials.jl:813 [inlined]
 [24] handle_connection(f::Function, c::HTTP.Connections.Connection{Sockets.TCPSocket}, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
    @ HTTP.Servers C:\Users\beorostica\.julia\packages\HTTP\A83Es\src\Servers.jl:447
 [25] macro expansion
    @ C:\Users\beorostica\.julia\packages\HTTP\A83Es\src\Servers.jl:385 [inlined]
 [26] (::HTTP.Servers.var"#16#17"{Mux.var"#14#15"{Mux.App, Mux.App}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.Connections.Connection}, Int64, Nothing, Base.Semaphore, HTTP.Connections.Connection{Sockets.TCPSocket}})()
    @ HTTP.Servers .\task.jl:514

I don't know how to trigger the problem using just WebIO.
This was reported here as an issue in the Blink Repo

@beorostica beorostica changed the title Concurrency Violation Error for multiple packages Concurrency Violation Error for multiple packages with multithreading in julia 1.9 May 18, 2023
@mosullivan93
Copy link
Contributor

@beorostica
It looks like WebIO v0.8.21 has been released with changes to (hopefully) remedy this. Could you please check if your application is working correctly now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants