Skip to content

Commit 8528d75

Browse files
committed
Address comment
1 parent 1282598 commit 8528d75

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

src/pb_stub.cc

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -723,17 +723,10 @@ Stub::ProcessRequests(RequestBatch* request_batch_shm_ptr)
723723
// the response batch. It is necessary to handle cases where the response
724724
// sender should have already cleaned up, ensuring the backend does not
725725
// delete the response factory again during error handling.
726-
if (err_message.find("Response sender has been closed") !=
727-
std::string::npos) {
728-
response_batch_shm_ptr->is_response_factory_deleted = true;
729-
} else if (
730-
err_message.find("is using the decoupled mode and the execute function "
731-
"must return None") != std::string::npos) {
732-
for (py::handle py_request : py_request_list) {
733-
InferRequest* request = py_request.cast<InferRequest*>();
734-
if (request->GetResponseSender()->IsClosed()) {
735-
response_batch_shm_ptr->is_response_factory_deleted = true;
736-
}
726+
for (py::handle py_request : py_request_list) {
727+
InferRequest* request = py_request.cast<InferRequest*>();
728+
if (request->GetResponseSender()->IsClosed()) {
729+
response_batch_shm_ptr->is_response_factory_deleted = true;
737730
}
738731
}
739732

@@ -846,16 +839,8 @@ Stub::ProcessReturnedResponses(
846839
}
847840
catch (const PythonBackendException& pb_exception) {
848841
// Handle the exception here to catch the error when there's a response
849-
// returned from `execute()`, and the below error message is thrown.
850-
// In default (non-decoupled) mode, the response factory should already
851-
// have been cleaned up when the previous response was sent by the
852-
// response sender. However, if the model attempts to return another
853-
// response from the `execute()` function, notify the backend NOT to
854-
// delete the response factory again during error handling.
855-
std::string err_message = pb_exception.what();
856-
if (err_message.find(
857-
"Non-decoupled model cannot send more than one response") !=
858-
std::string::npos) {
842+
// returned from `execute()`.
843+
if (request->GetResponseSender()->IsClosed()) {
859844
response_batch = std::move(shm_pool_->Construct<char>(
860845
sizeof(ResponseBatch) + sizeof(IPCMessageShm)));
861846
ResponseBatch* response_batch_shm_ptr =

src/python_be.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,6 @@ TRITONSERVER_Error*
10301030
ModelInstanceState::SendMessageToStub(
10311031
bi::managed_external_buffer::handle_t message)
10321032
{
1033-
// Stub()->StubMessageQueue()->Push(message);
10341033
bool success = false;
10351034
while (!success) {
10361035
uint64_t timeout_miliseconds = 1000;
@@ -1072,13 +1071,6 @@ ModelInstanceState::SendMessageAndReceiveResponse(
10721071
std::shared_ptr<std::vector<TRITONBACKEND_Response*>>& responses,
10731072
TRITONBACKEND_Request** requests, const uint32_t request_count)
10741073
{
1075-
// SendMessageToStub(message);
1076-
1077-
// bi::managed_external_buffer::handle_t response_message;
1078-
// Stub()->ReceiveMessageFromStub(response_message);
1079-
1080-
// response = response_message;
1081-
10821074
auto error = SendMessageToStub(message);
10831075
if (error != nullptr) {
10841076
RespondErrorToAllRequests(

0 commit comments

Comments
 (0)