Skip to content

Conversation

@AlexGPlay
Copy link
Contributor

@AlexGPlay AlexGPlay commented Oct 31, 2025

Summary

Closes #240887

Right now if a background search has 0 searches it stays in the "In progress" state but that's not correct. If no searches are added to the background search it means that something went wrong. With this PR we will label as error the search sessions if they have 0 searches after being created for 30 seconds.

Before After
image image

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@AlexGPlay AlexGPlay force-pushed the 240887-error-on-no-searches branch from dc32bc8 to 1534875 Compare October 31, 2025 10:26
// A session should is considered "new" for the first 30 seconds after creation. We need some arbitrary value here
// because if a sessions stays for too long with no searches assigned to it something happened and we should mark it as error.
// Some examples of possible issues: the browser is closed or in another tab the search requests are canceled.
const NEW_SESSION_THRESHOLD_SECONDS = 30;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

30 seconds is a totally arbitrary number, happy to change it to something else if it doesn't sound good

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #12 / Agents fleet_list_agent should return metrics if available and called with withMetrics
  • [job] [logs] FTR Configs #32 / Core Analysis - Entity Store @ess @skipInServerlessMKI Entity Store APIs start and stop "before all" hook for "should stop the entity engine"

Metrics [docs]

✅ unchanged

History

@AlexGPlay AlexGPlay self-assigned this Oct 31, 2025
@AlexGPlay AlexGPlay added release_note:skip Skip the PR/issue when compiling release notes Project:AsyncSearch Background search, partial results, async search services. Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// backport:version Backport to applied version labels v9.3.0 v9.2.1 labels Oct 31, 2025
@AlexGPlay AlexGPlay marked this pull request as ready for review October 31, 2025 12:15
@AlexGPlay AlexGPlay requested review from a team as code owners October 31, 2025 12:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal kertal requested a review from lukasolson October 31, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Project:AsyncSearch Background search, partial results, async search services. release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.2.1 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Background search] No search requests in background search should be handled as an error case

2 participants