-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add search diagnostics to deadline exceeded exceptions #621
Add search diagnostics to deadline exceeded exceptions #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check the test failure?
@@ -191,7 +191,8 @@ public SearchResponse handle(IndexState indexState, SearchRequest searchRequest) | |||
|
|||
diagnostics.setFirstPassSearchTimeMs(((System.nanoTime() - searchStartTime) / 1000000.0)); | |||
|
|||
DeadlineUtils.checkDeadline("SearchHandler: post recall", "SEARCH"); | |||
DeadlineUtils.checkDeadline( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a diagnostics parameter to checkDeadline
function, and append it to the message only when the error is being thrown? You can also consider keeping the existing function and adding a new checkDeadline with additional parameter in the signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is getting used in many places in the code, so I will create a new method with the additional param.
@@ -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", diagnostics.build(), "SEARCH"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarthakn7 I am a bit unsure about this part. Is it okay to log the build diagnostics or should I do some string conversion before logging? What would be the preferred way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can convert it to json before printing if you want to, but it's toString is also fine. You can also just log the Builder object rather than calling build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I used toString() in this case
Deadline deadline = Context.current().getDeadline(); | ||
if (deadline != null && deadline.isExpired()) { | ||
DeadlineMetrics.nrtDeadlineCancelCount.labels(operation).inc(); | ||
System.out.println(diagnostics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left over from debug
@@ -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", diagnostics.build(), "SEARCH"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can convert it to json before printing if you want to, but it's toString is also fine. You can also just log the Builder object rather than calling build.
* Fix node resolver for empty/missing files (#587) * Autogenerated JaCoCo coverage badge * Bump to v0.26.1 (#588) * Autogenerated JaCoCo coverage badge * parallel explain for nrtsearch (#589) * parallel explain for nrtsearch * fix nit * add explain for multi segment parallel * refactor isExplain in different contexts * make NRTSearch empty boolean query result constant score 1 (#592) * make NRTSearch empty boolean query result constant score 1 * fix tests * soft exception for fvh failures (#593) * Support unit in SortType (#590) create sort context and support unit in lat_lon distance sort * Autogenerated JaCoCo coverage badge * Upgrade dependencies for snyk check (#596) * Fix example-plugin test (#598) * Add page fault metrics (#599) * Add additional merge metrics (#607) * Add live setting for verbose index metrics (#608) * Add live setting for verbose index metrics * Address review comment * Autogenerated JaCoCo coverage badge * Bump to v0.29.0 (#609) * Add live index settings override from config file (#610) * Autogenerated JaCoCo coverage badge * Add ability to update local index live settings (#611) * Add deadline cancellation for indexing (#612) * Add geo polygon query type (#613) * Add geo polygon query type * Detect closed polygons, update docs * Autogenerated JaCoCo coverage badge * Bump to v0.30.0 (#615) * Testing readthedocs web hooks (#616) * Add a bare minimum readthedocs config file (#617) * log more info when fvh failed (#618) log more info when fvh failed * Avoid calling query.toString() (#619) * add sts for web identity auth (#620) add sts for web identity auth * Add search diagnostics to deadline exceeded exceptions (#621) * Add search diagnostics to deadline exceeded exceptions --------- Co-authored-by: swekannan <shwethu.kannan93@gmail.com> * Fixes and spotless apply * Updated grpc-gateway --------- Co-authored-by: Andrew Prudhomme <asp@yelp.com> Co-authored-by: github_actions <runner@fv-az248-700.3twvhzoricxu3figbgb44chhog.cx.internal.cloudapp.net> Co-authored-by: github_actions <runner@fv-az887-622.kyhrjabtieueri5x0cgfkhfc1a.bx.internal.cloudapp.net> Co-authored-by: Tao Yu <taoyu@yelp.com> Co-authored-by: waziqi89 <89210409+waziqi89@users.noreply.github.com> Co-authored-by: github_actions <runner@fv-az248-372.3twvhzoricxu3figbgb44chhog.cx.internal.cloudapp.net> Co-authored-by: github_actions <runner@fv-az574-753.esnmgxn14wlejbqjnvhsbsbtxa.dx.internal.cloudapp.net> Co-authored-by: github_actions <runner@fv-az1272-720.grsihaubamwerhiryzjrxtypna.phxx.internal.cloudapp.net> Co-authored-by: github_actions <runner@fv-az736-601.alpbqrzxv30uzkvtn2qktnuusd.cx.internal.cloudapp.net> Co-authored-by: Mohammad Mohtasham <mohm@yelp.com> Co-authored-by: swekannan <62616258+swekannan@users.noreply.github.com> Co-authored-by: swekannan <shwethu.kannan93@gmail.com>
Add search diagnostics for deadline exceeded exceptions for easier debugging of latencies.