-
Notifications
You must be signed in to change notification settings - Fork 498
Propagate cancellation within leaf search #6002
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,7 +186,7 @@ impl SearchService for SearchServiceImpl { | |
| .map(|req| req.split_offsets.len()) | ||
| .sum::<usize>(); | ||
|
|
||
| LeafSearchMetricsFuture { | ||
| let tracked_future = LeafSearchMetricsFuture { | ||
| tracked: multi_index_leaf_search( | ||
| self.searcher_context.clone(), | ||
| leaf_search_request, | ||
|
|
@@ -195,8 +195,9 @@ impl SearchService for SearchServiceImpl { | |
| start: Instant::now(), | ||
| targeted_splits: num_splits, | ||
| status: None, | ||
| } | ||
| .await | ||
| }; | ||
| let timeout = self.searcher_context.searcher_config.request_timeout(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the root search is wrapped with the same timeout value and we cancel all the in flight feature when we cancel the root search, why do we need this timeout? Belt and suspenders?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather not trust the RPC for cancellation. In case of connection drop, that would rely on the network level timeouts to perform the cancelation, and those are often hidden defaults that are hard to figure out. It's also close to impossible to test against regressions (even though to be honest the current cancellation also lacks tests and I didn't find a good solution yet). I also have this other PR where I enable different timeouts for different search sizes. In that PR the root timeout is disabled because the actual timeout is chosen on the leaf (open to change that, see PR description for details). |
||
| tokio::time::timeout(timeout, tracked_future).await? | ||
| } | ||
|
|
||
| async fn fetch_docs( | ||
|
|
||
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.
It would be easier to have the future return the split id.
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.
that doesn't work in case of panic (JoinError)