-
Notifications
You must be signed in to change notification settings - Fork 177
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
[python] Call_method in service now allows threads. #1760
Conversation
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.
clang-tidy made some suggestions
@@ -813,7 +813,9 @@ PyObject* client_call_method(PyObject* /*self*/, PyObject* args) // (client_ha | |||
PyArg_ParseTuple(args, "nsy#i", &client_handle, &method_name, &request, &request_len, &timeout); | |||
|
|||
bool called_method{ false }; | |||
called_method = client_call_method(client_handle, method_name, request, (int)request_len, timeout); | |||
Py_BEGIN_ALLOW_THREADS | |||
called_method = client_call_method(client_handle, method_name, request, (int)request_len, timeout); |
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.
warning: variable 'called_method' is not initialized [cppcoreguidelines-init-variables]
called_method = client_call_method(client_handle, method_name, request, (int)request_len, timeout); | |
called_method = 0 = client_call_method(client_handle, method_name, request, (int)request_len, timeout); |
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.
Somehow we missed that 👍
) (#1762) If service and client are located in the same process, the previous implementation of `call_method` caused deadlocks due to the GIL. Co-authored-by: Peguen <[email protected]>
) (#1761) If service and client are located in the same process, the previous implementation of `call_method` caused deadlocks due to the GIL. Co-authored-by: Peguen <[email protected]>
Description
If you used a service client and server in the same process (like described in this issue: #1755), the application locks. With this fix, it does not lock anymore and function as expected.