diff --git a/src/c++/perf_analyzer/periodic_concurrency_worker.cc b/src/c++/perf_analyzer/periodic_concurrency_worker.cc index 9fbaee3cc..9af3a9d87 100644 --- a/src/c++/perf_analyzer/periodic_concurrency_worker.cc +++ b/src/c++/perf_analyzer/periodic_concurrency_worker.cc @@ -55,6 +55,15 @@ PeriodicConcurrencyWorker::WorkerCallback(uint32_t infer_context_id) period_completed_callback_(); } if (ctxs_.at(infer_context_id)->HasReceivedFinalResponse()) { + bool has_not_completed_period{ + ctxs_.at(infer_context_id)->GetNumResponsesForCurrentRequest() < + request_period_}; + if (has_not_completed_period) { + throw std::runtime_error( + "Request received final response before request period was reached. " + "Request period must be at most the total number of responses " + "received by any request."); + } request_completed_callback_(); } }