aws / aws/amazon-sagemaker-examples
MMS BYO notebook does not detect OSError correctly
- 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
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