Skip to content

Commit a54796b

Browse files
lilaotensorflow-copybara
authored andcommitted
Allow model server to reload a config if it doesn't change from the previous loading attempt.
PiperOrigin-RevId: 760460942
1 parent ce91b97 commit a54796b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tensorflow_serving/model_servers/server_core.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ limitations under the License.
2424

2525
#include "google/protobuf/any.pb.h"
2626
#include "google/protobuf/wrappers.pb.h"
27+
#include "google/protobuf/util/message_differencer.h"
2728
#include "tensorflow/core/lib/core/stringpiece.h"
2829
#include "tensorflow/core/lib/io/path.h"
2930
#include "tensorflow/core/lib/strings/strcat.h"
@@ -453,7 +454,8 @@ Status ServerCore::ReloadConfig(const ModelServerConfig& new_config) {
453454
const bool accept_transition =
454455
is_first_config ||
455456
(config_.config_case() == ModelServerConfig::kModelConfigList &&
456-
new_config.config_case() == ModelServerConfig::kModelConfigList);
457+
new_config.config_case() == ModelServerConfig::kModelConfigList) ||
458+
protobuf::util::MessageDifferencer::Equals(config_, new_config);
457459
if (!accept_transition) {
458460
return errors::FailedPrecondition(
459461
"Cannot transition to requested config. It is only legal to transition "

0 commit comments

Comments
 (0)