aws / aws/amazon-sagemaker-examples

MMS BYO notebook does not detect OSError correctly

Open
#2,895 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

The multi-model serving BYO notebook apparently wants to retry if `subprocess.CalledProcessError` or `OSError` are raised, but only `subprocess.CalledProcessError` is detected correctly.

https://github.com/aws/amazon-sagemaker-examples/blob/cb28f5f09c536c8ce5db96c8cf06cd4913d762e9/advanced_functionality/multi_model_bring_your_own/container/dockerd-entrypoint.py#L12

The expression `CalledProcessError or OSError` evaluates simply to `CalledProcessError`. In order to test whether an object is an instance of one of listed classes, the class list should be passed as a tuple.

The issue can be fixed by replacing the referred line with `return isinstance(exception, (CalledProcessError, OSError))`

Contributor guide

Open the contributing guide

Research direction

Open advanced_functionality/multi_model_bring_your_own/container/dockerd-entrypoint.py and inspect the exception check at line 12. Verify that both subprocess.CalledProcessError and OSError are recognized for retry behavior, then confirm the notebook's container entrypoint still handles the existing error path correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.