Skip to content
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 a provider-level query timeout mechanism #109

Closed
data-sync-user opened this issue Nov 9, 2022 · 3 comments
Closed

Add a provider-level query timeout mechanism #109

data-sync-user opened this issue Nov 9, 2022 · 3 comments

Comments

@data-sync-user
Copy link
Collaborator

data-sync-user commented Nov 9, 2022

Given a search query, Merino will query it against all the providers (either the default providers or the specified ones). To reduce the query duration, all those query requests are executed concurrently. Merino will wait until all of the providers respond. That behavior may not be ideal for providers served by remote services as Merino could wait indefinitely if the service outage takes place.

Thus, we should add a timeout mechanism to Merino so that it will stop waiting once the timeout reaches; respond to the request with the already returned suggestions; possibly cancel the remaining requests and log the timeout event/metric.

┆Issue is synchronized with this Jira Task
┆Epic: Dynamic Wikipedia results on Firefox Suggest

@data-sync-user
Copy link
Collaborator Author

➤ Nan Jiang commented:

Notably, this can be readily implemented by the new asyncio.timeout() ( https://docs.python.org/3.11/library/asyncio-task.html#asyncio.timeout ) introduced in Python 3.11.

@data-sync-user
Copy link
Collaborator Author

@data-sync-user
Copy link
Collaborator Author

➤ Nan Jiang commented:

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant