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
GH-49146: [C++] Add option to disable atfork handlers (#49148)
### Rationale for this change
The atfork handlers we register in Arrow C++ are generally useful if the Arrow APIs are meant to be used from the child process, but they also have the unfortunate effect of executing non-async-signal-safe code in the child process even if Arrow is not be used there. That is [not allowed by POSIX](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_atfork.html) if the parent process is multi-threaded.
There are situations where fork() is only called just before exec(), and therefore it is not necessary to run any atfork handler.
### What changes are included in this PR?
1. Add a `GetEnvVarInteger` utility function to automate parsing of a numeric environment variable
2. Remove hard-coded size limitations for environment variable values on Windows
3. Add basic unit tests for our APIs for getting and setting environment variables
4. Add an environment variable `ARROW_REGISTER_ATFORK` to disable the registration of atfork handlers at runtime
### Are these changes tested?
The new environment variable cannot be easily tested automatically, so I've checked it manually.
### Are there any user-facing changes?
No, only a new feature.
* GitHub Issue: #49146
Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
0 commit comments