Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayv25 committed Sep 18, 2023
1 parent 3c27f67 commit 4c46a63
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/grpc/infer_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,16 @@ class InferHandlerState {


// Inserts the state to a set tracking active requests
// within the server core.
// within the server core. Should only be called when
// the request was successfully enqueued on Triton.
void InsertInflightState(
InferHandlerStateType* state, TRITONSERVER_InferenceRequest* irequest)
{
std::lock_guard<std::mutex> lock(mu_);
// The irequest_ptr_ will get populated when it is
// marked as active which means the request has been
// successfully enqueued to Triton core using
// TRITONSERVER_ServerInferAsync.
state->irequest_ptr_ = irequest;
inflight_states_.insert(state);
}
Expand All @@ -699,6 +704,9 @@ class InferHandlerState {
if (state->step_ != Steps::CANCELLED) {
LOG_VERBOSE(1) << "Issuing cancellation for " << state->unique_id_;
if (state->irequest_ptr_ == nullptr) {
// The context might be holding some states that have
// not been issued to Triton core. Need to skip calling
// issuing cancellation for such requests.
continue;
}
// Note that request may or may not be valid at this point.
Expand Down

0 comments on commit 4c46a63

Please sign in to comment.