Skip to content

Commit e6e78ce

Browse files
add missing error_callback when load is cancelled
PiperOrigin-RevId: 725934844
1 parent 88ff3dd commit e6e78ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tensorflow_serving/core/loader_harness.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,13 @@ Status LoaderHarness::Load() {
9191
// Servable is going to be unloaded very soon, we report a failure here so
9292
// that we do not accidentally report that the servable is available.
9393
TF_RETURN_IF_ERROR(UnloadDueToCancelledLoad());
94-
return errors::Cancelled(
95-
strings::StrCat("Loading of servable cancelled"));
94+
absl::Status s =
95+
errors::Cancelled(strings::StrCat("Loading of servable cancelled"));
96+
if (options_.error_callback) {
97+
// Invokes BasicManager::PublishOnEventBus(kEnd).
98+
options_.error_callback(id_, s);
99+
}
100+
return s;
96101
}
97102
{
98103
mutex_lock l(mu_);

0 commit comments

Comments
 (0)