You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Having an initializer that uses SearchLight after initializers/searchlight.jl causes a ConcurrencyViolationError. Probably because some async task (possibly connecting to the Database?) is still running when the second import of SearchLight occurs.
Error stacktrace
Loading initializersERROR: 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] _wait2(c::Condition, waiter::Task)
@ Base ./condition.jl:83
[6] wait(c::Condition)
@ Base ./condition.jl:120
[7] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1077
[8] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:1013
[9] require(into::Module, mod::Symbol)
@ Base ./loading.jl:997
[10] top-level scope
@ ~/workspace/projects/recultivate/RecultivateBackend/config/initializers/searchlight.jl:1
in expression starting at /home/dms449/workspace/projects/recultivate/RecultivateBackend/config/initializers/searchlight.jl:1
Ready!
julia>
To reproduce
1). create file config/initializers/temp.jl with only one line import SearchLight
2). try to load Genie app
Expected behavior
An initializer that uses SearchLight that comes after searchlight.jl will only be run AFTER SearchLight.jl is fully loaded
Additional context
happening on Julia 1.6.0 and 1.7.2
happening on latest Genie and Searchlight versions (4.17.0 and 2.2.0 respectively)
The text was updated successfully, but these errors were encountered:
dms449
changed the title
initializer using SearchLight that comes after searchlight.jl causes concurrency
initializer using SearchLight that comes after searchlight.jl causes ConcurrencyViolationError
Mar 31, 2022
A temporary hacky solution is to put a sleep(5) at the top of the initializer that depends on SearchLight. this gives it time to fully load before continueing.
UPDATE:
I'm actually having the same problem with the plugins as well. if my plugin attempts to import almost anything that another plugin is also importing, I run into problems.
NOTE: If I remove the Threads@threads in the Genie.load_plugins everything works. Surely other people have run into this problem? It's not that odd to have 2 plugins or 2 initializers that import the same thing for the first time.
Describe the bug
Having an initializer that uses SearchLight after initializers/searchlight.jl causes a ConcurrencyViolationError. Probably because some async task (possibly connecting to the Database?) is still running when the second import of SearchLight occurs.
Error stacktrace
To reproduce
1). create file
config/initializers/temp.jl
with only one lineimport SearchLight
2). try to load Genie app
Expected behavior
An initializer that uses SearchLight that comes after searchlight.jl will only be run AFTER SearchLight.jl is fully loaded
Additional context
The text was updated successfully, but these errors were encountered: