SearchWithRandomDisconnectsIT testSearchWithRandomDisconnect test-failure #132804
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.
In the 122707 test-failure we get the error
This draft PR, addresses(?) the resource leak reported by the leak tracker, which indicates that a search-phase-related resource (likely ArraySearchPhaseResults or a similar buffer) is not being properly released before garbage collection.
To mitigate this, the existing listener is wrapped by
ActionListener.runAfter, ensuring thatqueryResultConsumer::closeis always invoked once the search operation completes — whether it succeeds or fails:This hopefully ensures that the
queryResultConsumeris reliably closed after the original listener is notified, preventing the resource leak and aligning with the expected lifecycle management.This has not been extensively tested yet, but initial results suggest it resolves the issue in the
SearchWithRandomDisconnectsITtest case.cc @benchaplin (you are currently reviewing tests that disable batched execution)