Skip to content

Commit b9b5f52

Browse files
Log the old and new configs to ERROR when we fail to accept the transition.
PiperOrigin-RevId: 775437016
1 parent 40c49d7 commit b9b5f52

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tensorflow_serving/model_servers/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ cc_library(
9696
"//tensorflow_serving/util:event_bus",
9797
"//tensorflow_serving/util:unique_ptr_with_deps",
9898
"@com_google_absl//absl/base:core_headers",
99+
"@com_google_absl//absl/log",
99100
"@com_google_absl//absl/status",
100101
"@com_google_absl//absl/time",
101102
"@com_google_absl//absl/types:optional",

tensorflow_serving/model_servers/server_core.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ limitations under the License.
2525
#include "google/protobuf/any.pb.h"
2626
#include "google/protobuf/wrappers.pb.h"
2727
#include "google/protobuf/util/message_differencer.h"
28+
#include "absl/log/log.h"
2829
#include "tensorflow/core/lib/core/stringpiece.h"
2930
#include "tensorflow/core/lib/io/path.h"
3031
#include "tensorflow/core/lib/strings/strcat.h"
@@ -457,6 +458,10 @@ Status ServerCore::ReloadConfig(const ModelServerConfig& new_config) {
457458
new_config.config_case() == ModelServerConfig::kModelConfigList) ||
458459
protobuf::util::MessageDifferencer::Equals(config_, new_config);
459460
if (!accept_transition) {
461+
LOG(ERROR) << "Cannot transition to requested config. It is only legal to "
462+
"transition from one ModelConfigList to another.";
463+
LOG(ERROR) << "Old config: " << config_.DebugString();
464+
LOG(ERROR) << "New config: " << new_config.DebugString();
460465
return errors::FailedPrecondition(
461466
"Cannot transition to requested config. It is only legal to transition "
462467
"from one ModelConfigList to another.");

0 commit comments

Comments
 (0)