Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented Nov 6, 2025

If the index is deleted while querying, ES|QL might try to get the index routing from the latest cluster state. This could throw an index-not-found exception, which is not handled properly, causing the user to never receive a response, even though execution has completed. This also results in a dangling task in the task manager.

Relates #126653
Closes #135863

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @dnhatn, I've updated the changelog YAML for you.

@dnhatn dnhatn marked this pull request as ready for review November 6, 2025 23:14
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Nov 6, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

}
handler.messageReceived(request, channel, task);
});
}
Copy link
Member

Choose a reason for hiding this comment

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

Very cute.

private void expectNoFailure(String message, Exception e) {
LOGGER.error(message, e);
assert false : new AssertionError(message, e);
}
Copy link
Member

Choose a reason for hiding this comment

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

I believe the change to this file says "we expect no failures handling the response and if there is one log something big and loud and, if we're testing, crash loudly so we see if and fix it right away. If we're in production just be loud."

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's correct. In production, if a request enters this state, we will fail it fast and log the error.

.toList();
} catch (Exception ignored) {
continue;
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we continue on any exception here or just the one we get from the index being deleted. Is that just IndexNotFoundException?

Would you kindly add a comment around continue; saying "this is a shard being deleted after we started the request"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I added a comment in 691c5cd

@dnhatn dnhatn requested a review from nik9000 November 7, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.8 v9.1.8 v9.2.2 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ES|QL] Search Task is Stuck

3 participants