Skip to content

Commit

Permalink
Add search diagnostics to deadline exceeded exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
swekannan committed Feb 3, 2024
1 parent b0a4763 commit c24ba2f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public SearchResponse handle(IndexState indexState, SearchRequest searchRequest)

diagnostics.setFirstPassSearchTimeMs(((System.nanoTime() - searchStartTime) / 1000000.0));

DeadlineUtils.checkDeadline("SearchHandler: post recall", "SEARCH");
DeadlineUtils.checkDeadline("SearchHandler: post recall, Search Diagnostics: " + diagnostics, "SEARCH");

// add detailed timing metrics for query execution
if (profileResultBuilder != null) {
Expand All @@ -206,7 +206,7 @@ public SearchResponse handle(IndexState indexState, SearchRequest searchRequest)
hits = rescorer.rescore(hits, searchContext);
long endNS = System.nanoTime();
diagnostics.putRescorersTimeMs(rescorer.getName(), (endNS - startNS) / 1000000.0);
DeadlineUtils.checkDeadline("SearchHandler: post " + rescorer.getName(), "SEARCH");
DeadlineUtils.checkDeadline("SearchHandler: post " + rescorer.getName() + ", Search Diagnostics: " + diagnostics, "SEARCH");
}
diagnostics.setRescoreTimeMs(((System.nanoTime() - rescoreStartTime) / 1000000.0));
}
Expand Down Expand Up @@ -287,7 +287,7 @@ public SearchResponse handle(IndexState indexState, SearchRequest searchRequest)
}

// if we are out of time, don't bother with serialization
DeadlineUtils.checkDeadline("SearchHandler: end", "SEARCH");
DeadlineUtils.checkDeadline("SearchHandler: end, Search Diagnostics: " + diagnostics, "SEARCH");
SearchResponse searchResponse = searchContext.getResponseBuilder().build();
if (!warming && searchContext.getIndexState().getVerboseMetrics()) {
VerboseIndexCollector.updateSearchResponseMetrics(
Expand Down

0 comments on commit c24ba2f

Please sign in to comment.