-
Notifications
You must be signed in to change notification settings - Fork 149
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
XrdCl::DefaultEnv interferes with fork() #919
Comments
Hi David, Have you tried setting XRD_RUNFORKHANDLER=1 ? Cheers, |
You mean as an environment variable? Or in the code?
|
Hi David, I beg your pardon, I haven't read full description of your problem, and thanks for the reproducer! The problem is you create an instance of XrdCl::DefaultEnv, you mustn't be doing that (that's bad design on our side, the constructor should have been private). Instead please use the getter methods. For example, in order to get access to the logger do:
or if you want access to the environment itself do:
Hope this solves your problem. Let me know if I can close this issue. Cheers, |
Hi Michal, Right, now that I look at the code again I see the DefaultEnv object is completely unecessary, since the next line is using the static GetLog() as you suggest. When I remove the call to the DefaultEnv constructor the problem goes away. Thanks for the fast answers! I think you can close the ticket. Cheers, |
Any time :-) Cheers, |
I am using the XrdCl libraries in a C++ framework which uses libc fork() heavily. When I create a DefaultEnv object, for example to set the log level, the static methods defined there somehow interfere with fork() and cause it to hang. A simple example program to recreate the problem:
The process hangs at this point. Removing the XrdCl part, i.e. commenting out the first 3 lines of main(), allows the process to complete normally.
Attaching to the hanging process, one can see that the XrdCl prepare handler is being used:
Is there a way to avoid this problem?
The text was updated successfully, but these errors were encountered: