File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments