Enhance retry error handling with detailed context and VLM-CLOUD-PROD-MA detection #109
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.
Fix retry error handling to throw errors gracefully for VLM-CLOUD-PROD-MA
Summary
This PR enhances retry error handling across the VLM platform to provide more specific and actionable error information, particularly for the "VLM-CLOUD-PROD-MA" error scenario. The changes replace generic "unexpected-error" codes with specific error categorization and add detailed context to retry failures.
Key Changes:
_categorize_error()function to identify Modal infrastructure, network, timeout, and VLM-CLOUD-PROD-MA specific errorsReview & Testing Checklist for Human
"VLM-CLOUD-PROD-MA" in str(exception)needs validation with actual production errors_categorize_error()function categorizesmodal.exception.ModalExceptionbut needs verification with real Modal errors_get_callback_error_details()function with real webhook callback failuresRecommended Test Plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD A["vlm/infra/cloud/_modal.py"]:::major-edit --> B["handle_request_errors()"]:::major-edit A --> C["call_callback_with_retry()"]:::major-edit B --> D["_categorize_error()"]:::major-edit C --> E["_get_callback_error_details()"]:::major-edit F["vlmrun/client/base_requestor.py"]:::major-edit --> G["_handle_retry_error()"]:::major-edit H["Modal Infrastructure"]:::context --> D I["Callback URLs"]:::context --> E J["RetryError Exceptions"]:::context --> G D --> K["Specific Error Codes<br/>(modal-infrastructure-error,<br/>vlm-cloud-prod-ma-error, etc.)"]:::major-edit E --> L["Detailed Callback<br/>Error Context"]:::major-edit G --> M["Enhanced Retry<br/>Error Messages"]:::major-edit subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes