-
Notifications
You must be signed in to change notification settings - Fork 541
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
Suppress automatic GIL acquire to avoid deadlock #3037
Conversation
Explicitly disable Cython GIL acquire on entry into logging callbacks to avoid deadlock in multi-threaded C code which calls callback
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
The one thing this PR is missing is a good unit test for the problem being fixed. It's tricky because it would require us to set up a multi-threaded C function that calls the logging, compile that, and then call that function from Python. Any thoughts on a clean way to test this would be very welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change lgtm
rerun tests |
1 similar comment
rerun tests |
Codecov Report
@@ Coverage Diff @@
## branch-0.17 #3037 +/- ##
============================================
Coverage 59.26% 59.26%
============================================
Files 142 142
Lines 8962 8962
============================================
Hits 5311 5311
Misses 3651 3651 Continue to review full report at Codecov.
|
Affected by same issue as 3038. Looks like the extra xgboost package is gone, so I'll rerun this one more time. |
rerun tests |
As you said, it is difficult to write test for this scenario. However I think we should add multi-threaded logging statements to logger unit test file. Something like: #pragma omp parallel for n_threads(5)
for(int i = 0; i < 5; i++) {
CUML_LOG_INFO("Testing multi-threaded logging from thread: %d", omp_get_thread_num());
} This will ensure that we capture hang in logging if there is one. |
@vinaydes I don't think that's a bad idea, but unfortunately it wouldn't have caught this particular bug. Either way, if it's all right by you, I think let's add that in a separate PR, since it's not a test of this particular change. |
@wphicks Yeah, you are right. It would only work if we also write a Python test which calls the C++ test code. We can leave it for another PR. |
Explicitly disable Cython GIL acquire on entry into logging callbacks to avoid deadlock in multi-threaded C code which calls callback
Close #3027