Skip to content

Commit 815a5d4

Browse files
committed
Fix up
1 parent 8528d75 commit 815a5d4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/pb_stub.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,13 +720,15 @@ Stub::ProcessRequests(RequestBatch* request_batch_shm_ptr)
720720
response_batch.value().data_.get() + sizeof(IPCMessageShm));
721721

722722
// The backend will clean up the response factory if there is an error in
723-
// the response batch. It is necessary to handle cases where the response
724-
// sender should have already cleaned up, ensuring the backend does not
725-
// delete the response factory again during error handling.
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;
723+
// the response batch. For decoupled mode, it is necessary to handle cases
724+
// where the response sender should have already cleaned up, ensuring the
725+
// backend does not delete the response factory again during error handling.
726+
if (IsDecoupled()) {
727+
for (py::handle py_request : py_request_list) {
728+
InferRequest* request = py_request.cast<InferRequest*>();
729+
if (request->GetResponseSender()->IsClosed()) {
730+
response_batch_shm_ptr->is_response_factory_deleted = true;
731+
}
730732
}
731733
}
732734

0 commit comments

Comments
 (0)