-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix SearchErrorTraceIT and friends to work with batched query execution #132227
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
Merged
benchaplin
merged 16 commits into
elastic:main
from
benchaplin:fixup-search-error-trace-it
Sep 4, 2025
Merged
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
69bfa0a
Fix SearchErrorTraceIT and friends to work with batched query execution
original-brownbear ce6435c
Merge branch 'main' into fixup-search-error-trace-it
benchaplin b185eb1
Convert BytesTransportResponse
benchaplin 7684209
Merge branch 'main' into fixup-search-error-trace-it
drempapis 925d730
Merge branch 'main' into fixup-search-error-trace-it
drempapis 2ac4e98
Merge branch 'main' into fixup-search-error-trace-it
benchaplin ebca2bb
Merge branch 'main' into fixup-search-error-trace-it
drempapis a36a3ca
Merge branch 'main' into fixup-search-error-trace-it
benchaplin e647f43
Adjust approach for intercepting transport responses
benchaplin c9d625f
Merge branch 'main' into fixup-search-error-trace-it
benchaplin 9e5cfe8
Merge branch 'main' into fixup-search-error-trace-it
benchaplin 215b030
Merge branch 'main' into fixup-search-error-trace-it
benchaplin 512fce1
Merge branch 'main' into fixup-search-error-trace-it
benchaplin 3e68c7b
Merge branch 'main' into fixup-search-error-trace-it
benchaplin b0791f1
Merge branch 'main' into fixup-search-error-trace-it
benchaplin f19d164
Merge branch 'main' into fixup-search-error-trace-it
benchaplin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
I am not sure I follow the issue in the first place, as well as the proposed fix. The proposal is to add a new default method to TransportMessageListener, to then only ever use it in a test? Could you help me better understand what other options we have?
Uh oh!
There was an error while loading. Please reload this page.
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.
Async/SearchErrorTraceIT forces an error on all shards during a search. Before batched execution, this would trigger
onResponseSent(long requestId, String action, Exception error)
- called for every failed action response. We could then implement onResponseSent and inspect the exception to assert things (like whether the stack trace was present).Batched execution sends a non-error response even if all searches fail. We still want to inspect this response to assert the same things that were once captured in the exception. But TransportMessageListener has no hook to inspect non-error payloads, so this PR introduces one.
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.
hey Ben, sorry for the delay. I understand the problem better. I think this is a bit of an intrusive fix though. Isn't there another way to intercept responses in this specific test as opposed to using transport message listener? You may want to reach out to the distrib team and ask for advice on this.
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.
@javanna I've reworked the tests using a nice suggestion from @DaveCTurner - thanks for pushing for a better solution!