refactor(inner_index): change ErrorType to NO_ENOUGH_MEMORY for bad_alloc#1741
refactor(inner_index): change ErrorType to NO_ENOUGH_MEMORY for bad_alloc#1741
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors error handling by changing specific error types to Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request refines error handling by changing the VsagException error type from READ_ERROR or INTERNAL_ERROR to NO_ENOUGH_MEMORY when a std::bad_alloc exception is caught during deserialization in inner_index_interface.cpp and during buffer initialization in fp16_quantizer.cpp, providing more accurate error reporting.
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## 0.16 #1741 +/- ##
==========================================
+ Coverage 92.22% 92.30% +0.08%
==========================================
Files 295 295
Lines 15708 15708
==========================================
+ Hits 14486 14500 +14
+ Misses 1222 1208 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…lloc Cherry-pick of PR #1558 to 0.16 branch. - Change READ_ERROR to NO_ENOUGH_MEMORY in Deserialize methods - Change INTERNAL_ERROR to NO_ENOUGH_MEMORY in FP16Quantizer Note: The thread pool creation logic changes from PR #1558 are already present in 0.16 branch (hgraph.cpp, ivf.cpp check build_thread_count before creating default thread pool). Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Summary
Cherry-pick of PR #1558 to 0.16 branch.
Changes
READ_ERRORtoNO_ENOUGH_MEMORYinInnerIndexInterface::Deserializemethods when catchingstd::bad_allocINTERNAL_ERRORtoNO_ENOUGH_MEMORYinFP16Quantizer::ProcessQueryImplNote
The thread pool creation logic changes from PR #1558 are already present in 0.16 branch:
hgraph.cpp(line 96-99): already checksbuild_thread_count_ > 1before creating default thread poolivf.cpp(line 235-238): already checksthread_count > 1before creating default thread poolbrute_force.cpp: theSearchWithRequestparallel search code does not exist in 0.16 branchOriginal PR: #1558