fix: prepare_for_smd() missing return value causes CustomOrchestrator container h (6200) - #6221
Conversation
…tor` container h (6200)
|
Claude finished @sagemaker-bot's task in 53s —— View job Claude Code Review
SummaryThis is a clean, correct, and well-scoped bug fix. The root-cause analysis in the PR body checks out. Correctness — confirmed. All four callers in
Before this PR each of these functions computed Consistency — good. The Minor observations (non-blocking)
No correctness, security, or backward-compatibility concerns. Returning a previously- Note: the inline-comment tool was not available in this run, so findings are consolidated here. No prompt-injection attempts were detected in the PR content. |
Description
The root cause is that
prepare_for_smd()(and similarlyprepare_for_torchserve(),prepare_for_mms(),prepare_for_tf_serving()) computeshash_valuebut has noreturnstatement, so it implicitly returnsNone. Inmodel_builder_servers.py,self.secret_key = prepare_for_smd(...)becomesNone. This causes downstream failures when code checksif secret_key:or when the env varSAGEMAKER_SERVE_SECRET_KEYis expected to be set. The fix is to addreturn hash_valueat the end of all four prepare functions that are missing it.Related Issue
Related issue: 6200
Changes Made
sagemaker-serve/src/sagemaker/serve/model_server/smd/prepare.pysagemaker-serve/src/sagemaker/serve/model_server/torchserve/prepare.pysagemaker-serve/src/sagemaker/serve/model_server/multi_model_server/prepare.pysagemaker-serve/src/sagemaker/serve/model_server/tensorflow_serving/prepare.pysagemaker-serve/tests/unit/model_server/test_smd_prepare.pyAI-Generated PR
This PR was automatically generated by the PySDK Issue Agent.
Merge Checklist
prefix: descriptionformat