Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Make XRootDSource fork-safe #270

Merged
merged 2 commits into from
Apr 25, 2019
Merged

Conversation

nsmith-
Copy link
Member

@nsmith- nsmith- commented Apr 25, 2019

By setting the appropriate environment variable.

The bug this fixes is a hang in child processes triggered by use of uproot with XRootD files in multiprocessing or concurrent.futures process pools after doing so in the parent process. An example that triggers the bug is below:

#!/usr/bin/env python
import concurrent.futures
import uproot

file = "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_DoubleMuParked.root"

def read(fn):
    print("starting work")
    with uproot.open(fn) as f:
        print("opened file")
        sumw = f['Events'].numentries
    return sumw

print(read(file))

with concurrent.futures.ProcessPoolExecutor(max_workers=1) as executor:
    future = executor.submit(read, file)
    print(future.result())

By setting the appropriate environment variable
@nsmith-
Copy link
Member Author

nsmith- commented Apr 25, 2019

I couldn't find much documentation on why one would ever not want this option enabled. There is xrootd/xrootd#897

@jpivarski
Copy link
Member

Unless you have any objection, I'll take this when the tests pass. It will combine with PR #269 to become uproot 0.5.1.

@jpivarski jpivarski merged commit fc40682 into scikit-hep:master Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants