Skip to content

Commit f3bdcc7

Browse files
authored
fix: Fix race condition in model loading/unloading in Sagemaker server (#8571)
1 parent d697e8d commit f3bdcc7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/sagemaker_server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ SagemakerAPIServer::SageMakerMMEUnloadModel(
649649
target_model = model_name_hash;
650650
}
651651

652+
std::lock_guard<std::mutex> lock(models_list_mutex_);
652653
if (sagemaker_models_list_.find(model_name_hash) ==
653654
sagemaker_models_list_.end()) {
654655
LOG_VERBOSE(1) << "Model " << target_model << " with model hash "
@@ -743,7 +744,6 @@ SagemakerAPIServer::SageMakerMMEUnloadModel(
743744

744745
TRITONSERVER_ErrorDelete(unregister_err);
745746

746-
std::lock_guard<std::mutex> lock(models_list_mutex_);
747747
sagemaker_models_list_.erase(model_name_hash);
748748
}
749749

0 commit comments

Comments
 (0)