fix(sagemaker): Adjust retry configuration for StartSession #8219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When a user tries to connect to a SageMaker Space that is in the Stopped status (i.e., the underlying App is Deleted or has not been created), the Space will be automatically started by the toolkit before the connection is attempted. In some cases, the Space reaches the Running status (i.e., the App reaches the InService status) but the remote access capability is not yet ready as it starts asynchronously, leading to the SageMaker:StartSession API receiving an Internal Failure response. The client already retries, but the retries happen too quickly, before remote access becomes ready.
Solution
Adjust the SageMaker client retry configuration for StartSession calls made from the detached server (called via the
sagemaker_connectscript) to spread out the retries over multiple seconds.feature/xbranches will not be squash-merged at release time.