Skip to content

CPS: Force establish a connection with a short timeout for _resolve/index + other tiny refactorings#138658

Draft
pawankartik-elastic wants to merge 10 commits intoelastic:mainfrom
pawankartik-elastic:pkar/resolve-index-force-reconn
Draft

CPS: Force establish a connection with a short timeout for _resolve/index + other tiny refactorings#138658
pawankartik-elastic wants to merge 10 commits intoelastic:mainfrom
pawankartik-elastic:pkar/resolve-index-force-reconn

Conversation

@pawankartik-elastic
Copy link
Contributor

@pawankartik-elastic pawankartik-elastic commented Nov 26, 2025

This PR contains the following changes:

  1. Swaps out an inappropriate disconnected strategy with a connection strategy that's ideal for CPS (and previously used in TransportSearchAction),
    • We'd want to wait for a short duration and bail out if a linked project is unresponsive. This is a prerequisite as we plan on adding tests that exercise this scenario in the near future.
  2. Swaps out unnecessary usage of SortedMap,
  3. Swaps out the combination for CountDown and Runnable in favour of GroupedActionListener, which essentially does something similar under the hood (this cuts down unnecessary exposed boilerplate code),
  4. Removes the temporary assertion on the number of requests fanned out and the responses received — a more appropriate fix is approved and pending merge.
// Add a short timeout for Cross Project Search requests only.
if (resolveCrossProject) {
connectionListener.addTimeout(
TimeValue.timeValueSeconds(3L),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can move 3L out in favour of a final class member.

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

2 participants