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

ARROW-18383: [C++] Avoid global variables for thread pools and at-fork handlers #14704

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Nov 22, 2022

Initialization order of module globals is undefined.

In a particular case, the IO thread pool would first be instantiated at library load, registering an at-fork handler.
Then, only after, the at-fork handlers would be initialized, losing the handler registered just before.

@pitrou pitrou marked this pull request as draft November 22, 2022 19:24
@github-actions
Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW

Opening JIRAs ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename pull request title in the following format?

ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@pitrou
Copy link
Member Author

pitrou commented Nov 22, 2022

@github-actions crossbow submit -g cpp

@pitrou
Copy link
Member Author

pitrou commented Nov 22, 2022

@paleolimbot This seems to fix the R issues with mclapply you discovered.

@github-actions

This comment was marked as outdated.

@paleolimbot
Copy link
Member

I checked my little to R process forking reprex from #14250 (mclapply()) against this Arrow build and it works!

…k handlers

Initialization order of module globals is undefined.

In a particular case, the IO thread pool would first be instantiated at library load, registering an at-fork handler.
Then, only after, the at-fork handlers would be initialized, losing the handler registered just before.
@pitrou pitrou changed the title DRAFT: [C++] Avoid running complex constructors at library load ARROW-18383: [C++] Avoid global variables for thread pools and at-fork handlers Nov 22, 2022
@pitrou pitrou marked this pull request as ready for review November 22, 2022 22:27
@github-actions
Copy link

@github-actions
Copy link

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@pitrou
Copy link
Member Author

pitrou commented Nov 22, 2022

@github-actions crossbow submit -g cpp

@github-actions
Copy link

Revision: be52dbc

Submitted crossbow builds: ursacomputing/crossbow @ actions-c54517457f

Task Status
test-alpine-linux-cpp Github Actions
test-build-cpp-fuzz Github Actions
test-conda-cpp Github Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp Github Actions
test-debian-10-cpp-amd64 Github Actions
test-debian-10-cpp-i386 Github Actions
test-debian-11-cpp-amd64 Github Actions
test-debian-11-cpp-i386 Github Actions
test-fedora-35-cpp Github Actions
test-ubuntu-18.04-cpp Github Actions
test-ubuntu-18.04-cpp-release Github Actions
test-ubuntu-18.04-cpp-static Github Actions
test-ubuntu-20.04-cpp Github Actions
test-ubuntu-20.04-cpp-20 Github Actions
test-ubuntu-20.04-cpp-bundled Github Actions
test-ubuntu-20.04-cpp-thread-sanitizer Github Actions
test-ubuntu-22.04-cpp Github Actions

@pitrou pitrou merged commit b1f65ea into apache:master Nov 23, 2022
@pitrou pitrou deleted the cpp-state-lazy branch November 23, 2022 16:15
@ursabot
Copy link

ursabot commented Nov 25, 2022

Benchmark runs are scheduled for baseline = 1121bbc and contender = b1f65ea. b1f65ea is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.13% ⬆️0.03%] test-mac-arm
[Failed] ursa-i9-9960x
[Finished ⬇️0.38% ⬆️0.07%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] b1f65ea4 ec2-t3-xlarge-us-east-2
[Finished] b1f65ea4 test-mac-arm
[Finished] b1f65ea4 ursa-i9-9960x
[Finished] b1f65ea4 ursa-thinkcentre-m75q
[Finished] 1121bbcf ec2-t3-xlarge-us-east-2
[Finished] 1121bbcf test-mac-arm
[Failed] 1121bbcf ursa-i9-9960x
[Finished] 1121bbcf ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

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

Successfully merging this pull request may close these issues.

4 participants