Skip to content

Commit 30a0f99

Browse files
committed
Update
1 parent 353540b commit 30a0f99

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/python_be.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,13 +2424,15 @@ TRITONBACKEND_ModelInstanceReady(TRITONBACKEND_ModelInstance* instance)
24242424
ModelInstanceState* instance_state =
24252425
reinterpret_cast<ModelInstanceState*>(vstate);
24262426

2427+
// Check if the stub process is running
24272428
if (!instance_state->Stub()->StubActive()) {
24282429
return TRITONSERVER_ErrorNew(
24292430
TRITONSERVER_ERROR_INTERNAL, (std::string("Stub process '") +
24302431
instance_state->Name() + "' is not alive")
24312432
.c_str());
24322433
}
24332434

2435+
// Check if the stub process is responsive
24342436
if (!instance_state->IsStubProcessAlive()) {
24352437
return TRITONSERVER_ErrorNew(
24362438
TRITONSERVER_ERROR_INTERNAL,

src/stub_launcher.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,16 @@ StubLauncher::StubActive()
751751
pid_t return_pid = waitpid(stub_pid_, &status, WNOHANG);
752752
if (return_pid == -1) {
753753
// If waitpid fails, it likely means the process no longer exists (ECHILD)
754-
stub_pid_ = 0;
754+
if (errno != ECHILD) {
755+
LOG_MESSAGE(
756+
TRITONSERVER_LOG_VERBOSE,
757+
(std::string("waitpid failed for stub process ") +
758+
std::to_string(stub_pid_) + ": " + strerror(errno))
759+
.c_str());
760+
}
755761
return false;
756762
} else if (return_pid == stub_pid_) {
757763
// Process has exited and has been reaped
758-
stub_pid_ = 0;
759764
return false;
760765
}
761766

0 commit comments

Comments
 (0)