-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[AINode] More accurate exception for model management #16895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors exception handling in the AINode model management system to provide clearer and more accurate error reporting. The changes involve renaming classes and methods for consistency, reorganizing error status codes, and improving exception handling patterns across both Java and Python codebases.
Key changes include:
- Renamed "Training" terminology to "Tuning" to better reflect the operation's purpose (TTrainingReq → TTuningReq, CreateTrainingTask → CreateTuningTask, etc.)
- Standardized Python exception naming from "*Error" suffix to "*Exception" suffix across the entire AINode codebase
- Reorganized TSStatusCode enum with more specific error codes (MODEL_EXISTED_ERROR, MODEL_NOT_EXIST_ERROR, CREATE_MODEL_ERROR, DROP_BUILTIN_MODEL_ERROR, etc.) replacing generic codes
- Improved error messages and validation (e.g., "Device ID" → "AIDevice ID" for consistency)
- Removed unused ModelNotFoundException class and methods (get_model_infos, get_registered_models)
- Refactored model storage methods with better documentation and moved helper functions to utils module
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 26 comments.
Show a summary per file
| File | Description |
|---|---|
| ainode.thrift | Renamed TTrainingReq to TTuningReq and createTrainingTask to createTuningTask; reorganized service method ordering |
| CreateTuningTask.java | Renamed class and constructors from CreateTrainingTask to CreateTuningTask |
| IConfigTaskExecutor.java | Renamed createTraining method to createTuningTask |
| ClusterConfigTaskExecutor.java | Updated imports and method names; improved variable naming (ai → aiNodeClient) |
| TreeConfigTaskVisitor.java | Updated imports to use CreateTuningTask |
| TableConfigTaskVisitor.java | Updated imports and instantiation to use CreateTuningTask |
| AINodeClient.java | Updated imports and method signature for createTuningTask |
| ModelNotFoundException.java | Deleted file - no longer needed |
| GetModelInfoException.java | Changed to use AINODE_INTERNAL_ERROR status code |
| serde.py | Renamed BadConfigValueError to BadConfigValueException |
| handler.py | Renamed exception references; reorganized methods with section comments; improved error codes and messages |
| utils.py | Added _fetch_model_from_local and _fetch_model_from_hf_repo helper functions; improved exception handling |
| pipeline_timer.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| pipeline_sundial.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| modeling_sktime.py | Renamed BuiltInModelNotSupportError and InferenceModelInternalError to Exception suffix |
| configuration_sktime.py | Renamed WrongAttributeTypeError and BuiltInModelNotSupportError to Exception suffix |
| model_storage.py | Refactored register_model and delete_model with better error handling; removed unused methods; improved documentation |
| model_loader.py | Renamed ModelNotExistError to ModelNotExistException |
| utils.py (manager) | Renamed ModelNotExistError to ModelNotExistException |
| model_manager.py | Updated exception handling with specific exception types and status codes |
| inference_manager.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| basic_pool_scheduler.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| pool_group.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| pool_controller.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| basic_dispatcher.py | Renamed InferenceModelInternalError to InferenceModelInternalException |
| exception.py | Renamed all exception classes from *Error to *Exception; added new model-specific exceptions; reorganized with section comments |
| constant.py | Reorganized TSStatusCode enum with more specific AI error codes; removed HyperparameterName enum |
| config.py | Renamed BadNodeUrlError to BadNodeUrlException |
| TSStatusCode.java | Reorganized AI error codes (1500-1599 range) with more specific codes |
| AINodeClusterConfigIT.java | Removed TODO comment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #16895 +/- ##
=========================================
Coverage 39.02% 39.02%
Complexity 207 207
=========================================
Files 5022 5021 -1
Lines 333375 333373 -2
Branches 42431 42431
=========================================
+ Hits 130105 130106 +1
+ Misses 203270 203267 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
(cherry picked from commit c722aaf)
(cherry picked from commit c722aaf)



Refactor the exception throw for clear error handling.