Skip to content

fix: correct returned ErrorType in deserialize method (0.15)#1735

Open
wxyucs wants to merge 1 commit into0.15from
fix-1557-in-v015
Open

fix: correct returned ErrorType in deserialize method (0.15)#1735
wxyucs wants to merge 1 commit into0.15from
fix-1557-in-v015

Conversation

@wxyucs
Copy link
Collaborator

@wxyucs wxyucs commented Mar 20, 2026

fixes: #1557

fixes: #1557

Signed-off-by: Xiangyu Wang <wxy407827@antgroup.com>
@wxyucs wxyucs requested a review from LHT129 March 20, 2026 07:42
@wxyucs wxyucs self-assigned this Mar 20, 2026
@wxyucs wxyucs requested a review from inabao as a code owner March 20, 2026 07:42
@wxyucs wxyucs added kind/bug Something isn't working version/0.15 labels Mar 20, 2026
Copilot AI review requested due to automatic review settings March 20, 2026 07:42
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 refines the error handling within the deserialization logic by ensuring that out-of-memory conditions are reported with the correct error type. This change improves the precision of error reporting, making it easier to diagnose and address memory-related issues during data loading.

Highlights

  • Error Handling: Corrected the ErrorType thrown when a std::bad_alloc exception occurs during the deserialization process. Previously, ErrorType::READ_ERROR was thrown, but it has been updated to ErrorType::NO_ENOUGH_MEMORY to accurately reflect the underlying cause.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request corrects the ErrorType thrown during deserialization when a std::bad_alloc exception is caught, changing it from READ_ERROR to NO_ENOUGH_MEMORY. The change is correct. For consistency, you may want to review other catch (const std::bad_alloc& e) blocks. For instance, the InnerIndexInterface::Deserialize(const ReaderSet&) method in the same file appears to have a similar issue where READ_ERROR is thrown instead of NO_ENOUGH_MEMORY.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates InnerIndexInterface::Deserialize to throw a more specific ErrorType when deserialization fails due to an out-of-memory condition (fix for #1557).

Changes:

  • Map std::bad_alloc during deserialization to ErrorType::NO_ENOUGH_MEMORY instead of ErrorType::READ_ERROR.

return;
} catch (const std::bad_alloc& e) {
throw VsagException(ErrorType::READ_ERROR, "failed to Deserialize: ", e.what());
throw VsagException(ErrorType::NO_ENOUGH_MEMORY, "failed to Deserialize: ", e.what());
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message text uses an unusual capitalization (“Deserialize”) mid-sentence. Consider changing it to a consistent, conventional form like “failed to deserialize” (and optionally include the fully-qualified function name) to improve log/search consistency.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

❌ Your patch check 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.15    #1735      +/-   ##
==========================================
+ Coverage   90.18%   90.27%   +0.08%     
==========================================
  Files         218      218              
  Lines       13518    13518              
==========================================
+ Hits        12191    12203      +12     
+ Misses       1327     1315      -12     
Flag Coverage Δ
cpp 90.27% <0.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 93.36% <ø> (ø)
datacell 91.52% <ø> (-0.10%) ⬇️
index 88.62% <0.00%> (+0.23%) ⬆️
simd 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2822f1d...96a925c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/XS version/0.15

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants