From c24ba2f78b974e21a12f77dfe5cfd4118c590d81 Mon Sep 17 00:00:00 2001 From: swethakannan12 Date: Fri, 2 Feb 2024 17:39:13 -0800 Subject: [PATCH] Add search diagnostics to deadline exceeded exceptions --- .../yelp/nrtsearch/server/luceneserver/SearchHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/SearchHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/SearchHandler.java index 27313c9a5..abc992102 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/SearchHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/SearchHandler.java @@ -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) { @@ -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)); } @@ -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(