File tree 1 file changed +16
-1
lines changed
qa/python_models/execute_cancel
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -102,11 +102,26 @@ def response_thread(execute_processed_requests, processed_requests):
102
102
flags = pb_utils .TRITONSERVER_RESPONSE_COMPLETE_FINAL
103
103
)
104
104
else :
105
+ # test response_sender.send() after it is closed upon checking for
106
+ # confirmed request cancelled
105
107
dummy_tensor = pb_utils .Tensor (
106
108
"DUMMY_OUT" , np .array ([[1 ]], np .single )
107
109
)
108
110
dummy_response = pb_utils .InferenceResponse ([dummy_tensor ])
109
- response_sender .send (dummy_response )
111
+ raised_exception = False
112
+ try :
113
+ response_sender .send (dummy_response )
114
+ except pb_utils .TritonModelException as e :
115
+ if (
116
+ "Unable to send response. Response sender has been closed."
117
+ not in str (e )
118
+ ):
119
+ raise e
120
+ raised_exception = True
121
+ if not raised_exception :
122
+ raise pb_utils .TritonModelException (
123
+ "response_sender did not raise an exception on send after closed"
124
+ )
110
125
111
126
thread = threading .Thread (
112
127
target = response_thread ,
You can’t perform that action at this time.
0 commit comments