-
Notifications
You must be signed in to change notification settings - Fork 15
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
Specify API-level search timeout to reduce hard timeout errors. #81
Conversation
Need to look into whether the metrics can be updated when the new type of timeout produces incomplete results. |
@@ -59,7 +59,7 @@ async def start(self) -> bool: | |||
return False | |||
hosts = [{'host': self._elastic_host, 'port': self._elastic_port}] | |||
self.sync_client = AsyncElasticsearch(hosts, timeout=self.sync_timeout) | |||
self.search_client = AsyncElasticsearch(hosts, timeout=self.search_timeout) | |||
self.search_client = AsyncElasticsearch(hosts, timeout=self.search_timeout+1) |
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.
What was the +1 for? Can this be removed?
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.
If the transport timeout is less than (or possibly equal to) the API timeout, then we will likely continue to get hard timeout errors. Bumping it by 1 is a way of pushing it out beyond the API timeout. The API timeout should trigger first, and we get partial results.
I could make the API timeout some fraction of the transport timeout...
This reverts commit 28c711e.
bump in different way.
See #71 for context.
#71 (comment)
The effect should be that the ES server side will notice that time budget has run out. Then it should return partial results without an error. This may make things smoother for clients, though it means that results might not be complete until performance blip goes away.
I've run some of the lbry-sdk integration tests (tests/integration/claims).