Skip to content

Commit

Permalink
[Python] Fix deadlock: call_method in service now allows threads. (#1760
Browse files Browse the repository at this point in the history
) (#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 <73380451+Peguen@users.noreply.github.com>
  • Loading branch information
eclipse-ecal-bot and Peguen authored Oct 4, 2024
1 parent c1f2e51 commit b3e63fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lang/python/core/src/ecal_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,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);
Py_END_ALLOW_THREADS

return(Py_BuildValue("i", called_method));
}
Expand Down

0 comments on commit b3e63fc

Please sign in to comment.