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

Specify API-level search timeout to reduce hard timeout errors. #81

Merged
merged 4 commits into from
Sep 12, 2022

Conversation

moodyjon
Copy link
Contributor

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).

@moodyjon
Copy link
Contributor Author

Need to look into whether the metrics can be updated when the new type of timeout produces incomplete results.

@moodyjon moodyjon marked this pull request as draft August 18, 2022 04:16
@moodyjon moodyjon marked this pull request as ready for review August 18, 2022 15:13
@@ -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)
Copy link
Member

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?

Copy link
Contributor Author

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...

@lbry-bot lbry-bot assigned moodyjon and unassigned jackrobison and moodyjon Aug 24, 2022
@moodyjon moodyjon requested a review from jackrobison August 24, 2022 16:45
@lbry-bot lbry-bot assigned jackrobison and unassigned moodyjon Aug 24, 2022
@lbry-bot lbry-bot assigned moodyjon and unassigned jackrobison Sep 12, 2022
@jackrobison jackrobison merged commit 18e0571 into lbryio:master Sep 12, 2022
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

Successfully merging this pull request may close these issues.

3 participants