Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/pb_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1496,8 +1496,16 @@ Stub::GetCUDAMemoryPoolAddress(std::unique_ptr<IPCMessage>& ipc_message)
*(ipc_message->ResponseMutex())};
cuda_pool_message_ptr->waiting_on_stub = true;
ipc_message->ResponseCondition()->notify_all();
while (cuda_pool_message_ptr->waiting_on_stub) {
ipc_message->ResponseCondition()->wait(lock);
// This handler runs on the single ParentToStubMQMonitor thread,
// which also delivers decoupled BLS responses,
// so it must not block on the success path.
// It should only wait when an error message has been written to
// error_string_shm, so the parent can finish reading it before
// this function returns and frees that shared memory.
if (has_exception) {
while (cuda_pool_message_ptr->waiting_on_stub) {
ipc_message->ResponseCondition()->wait(lock);
}
}
}
#endif
Expand Down Expand Up @@ -1849,7 +1857,7 @@ PYBIND11_EMBEDDED_MODULE(c_python_backend_utils, module)
auto stub = Stub::GetOrCreateInstance();
py::object loop =
py::module_::import("asyncio").attr("get_running_loop")();
py::cpp_function callback = [&stub, infer_request, decoupled]() {
py::cpp_function callback = [stub, infer_request, decoupled]() {
std::shared_ptr<InferResponse> response =
infer_request->Exec(decoupled);
py::object response_object;
Expand Down
Loading