Skip to content
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

[Releases 2.13] Output hybrid error message in marqo logs #1108

Open
wants to merge 1 commit into
base: releases/2.13
Choose a base branch
from

Conversation

vicilliar
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    bug fix

  • What is the current behavior? (You can also link to an open issue here)
    any errors in tensor or lexical search in hybrid rrf search are swallowed by java code

  • What is the new behavior (if this is a feature change)?
    output any tensor or lexical errors in marqo logs

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    no

  • Have unit tests been run against this PR? (Has there also been any additional testing?)

  • Related Python client changes (link commit/PR here)

  • Related documentation changes (link commit/PR here)

  • Other information:

  • Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)

@vicilliar vicilliar marked this pull request as ready for review January 30, 2025 06:44
@vicilliar vicilliar force-pushed the joshua/output-hybrid-searcher-error branch from 2d3ecb5 to fb1c54d Compare January 30, 2025 06:47
@vicilliar vicilliar requested a review from papa99do January 30, 2025 06:48
@vicilliar vicilliar changed the title Output hybrid error message in marqo logs [Releases 2.13] Output hybrid error message in marqo logs Jan 30, 2025
Copy link
Collaborator

@papa99do papa99do left a comment

Choose a reason for hiding this comment

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

Please check with Vespa team about the best practices of handling errors in the search chain.

@@ -105,6 +106,8 @@ public Result search(Query query, Execution execution) {
+ e.toString());
}

raiseErrorIfPresent(resultLexical, resultTensor);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was wondering if we should handle errors differently after reading Vespa docs. Instead of raising Runtime exception everywhere (which cause Vespa to always return 500). We should probably leverage HitGroup().addError method which is suggested in this doc.

For this specific scenario, we are collecting errors from both lexical result and tensor result. So we can do this:

HitGroup combinedErrors = new HitGroup();
combinedErrors.addErrorsFrom(resultTensor.hits());
combinedErrors.addErrorsFrom(resultLexical.hits());
if (combinedErrors.getError() != null) {
      return new Result(query, combinedErrors);
}

In this way, you should be able to collect all the errors from both result and allow search chain to handle the error properly, instead of just concatenating the first error found in each result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants