Skip to content

Keep scroll contexts on transient search queue rejection - #155697

Open
reugn wants to merge 2 commits into
elastic:mainfrom
reugn:fix/scroll-survive-queue-rejection
Open

Keep scroll contexts on transient search queue rejection#155697
reugn wants to merge 2 commits into
elastic:mainfrom
reugn:fix/scroll-survive-queue-rejection

Conversation

@reugn

@reugn reugn commented Aug 2, 2026

Copy link
Copy Markdown
Member

When a scroll continuation is rejected by a full search thread pool, SearchService.processFailure freed the scroll reader context. The rejection happens at submission before scroll state advances, so the client still has a usable scroll_id but retries fail because the context is gone.

The fix keeps the context on transient EsRejectedExecutionException (not executor shutdown) for InternalScrollSearchRequest query and fetch continuations only. If the initial scroll search is rejected before the client gets a scroll_id (including the DFS query phase), the context is still freed so it cannot leak until keep-alive expires. The legacy query-and-fetch scroll fetch path also retains on rejection; the new IT covers the usual scroll query path only.

Fixes #90912

@reugn reugn added >bug auto-backport Automatically create backport pull requests when merged Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations v8.19.0 v9.3.0 v9.4.0 v9.5.0 v9.6.0 labels Aug 2, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @reugn, I've created a changelog YAML for you.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@reugn
reugn requested a review from cbuescher August 2, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.19.0 v9.3.0 v9.4.0 v9.5.0 v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scroll requests are not resilient to queue rejections

2 participants