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

ConcurrencyViolationError when reading with XRootD #310

Closed
peremato opened this issue Mar 12, 2024 · 2 comments · Fixed by #311
Closed

ConcurrencyViolationError when reading with XRootD #310

peremato opened this issue Mar 12, 2024 · 2 comments · Fixed by #311

Comments

@peremato
Copy link
Member

Using the latest UnROOT v0.10.24 and accessing remote files with xrootd I get a crash

ERROR: ERROR: ConcurrencyViolationError("lock must be held")
Stacktrace:
  [1] concurrency_violation()
    @ Base ./condition.jl:8
  [2] assert_havelock(l::ReentrantLock, tid::Nothing)
    @ Base ./condition.jl:25 [inlined]
  [3] assert_havelock(l::ReentrantLock, tid::Nothing)
...

A easy reproducer is:

using UnROOT

f = "root://eospublic.cern.ch//eos/opendata/cms/Run2016G/DoubleMuon/NANOAOD/UL2016_MiniAODv2_NanoAODv9-v2/2430000/05DD095C-F6C3-9A4F-9FB3-348A5A6403D5.root"
events = LazyTree(ROOTFile(f), "Events")

total_E = Threads.Atomic{Float32}(0.0)
nsel = Threads.Atomic{Int64}(0)

@time Threads.@threads for evt in events
    evt.nMuon != 4 && continue
    (all(evt.Muon_pt .> 5) && all(abs.(evt.Muon_eta) .< 2.4)) || continue
    sum(evt.Muon_charge) != 0 && continue
    E = sum(evt.Muon_pt .* cosh.(evt.Muon_eta))
    Threads.atomic_add!(total_E, E)
    Threads.atomic_add!(nsel, 1)
end
println("<Eμ>/event $(total_E.value/nsel.value)GeV")
@tamasgal
Copy link
Member

Using the file locally works, right?

@peremato
Copy link
Member Author

Yes. Perfectly.

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

Successfully merging a pull request may close this issue.

3 participants