Skip to content

Adjust search client retry attempts #3426

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

Merged
merged 1 commit into from
Mar 16, 2020
Merged

Conversation

isoos
Copy link
Collaborator

@isoos isoos commented Mar 12, 2020

Fixes #3363. The prior PR added the 5-second timeout, but the default retry on the method tried it a second time, making the original request serving to 10+ seconds. In one case this caused the user to reload the same search query several more times.

@isoos isoos changed the title Adjust search client retry attemts Adjust search client retry attempts Mar 12, 2020
Copy link
Member

@jonasfj jonasfj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to make a metrics for how often this fails..

serviceUrl,
timeout: Duration(seconds: 5),
// limit to a single attempt, no need to retry after timeout
retryCount: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're reusing the _httpClient, so if there are connections in pool, where the remote side has closed down, we get a quick disconnect and we don't retry..

Is that wise?

Another strategy is to retry if the request didn't take 3s. It's quite common for idle TCP connections to have the remote side shutdown, without anyone noticing locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we should also discard the _httpClient instance when this happens, as other connections could be stale too. I've filed #3431 to track it.

@isoos
Copy link
Collaborator Author

isoos commented Mar 16, 2020

Maybe we need to make a metrics for how often this fails..

Currently we can filter for SEVERE log entry 'Unable to search packages'.

@isoos isoos merged commit bb2f5bf into dart-lang:master Mar 16, 2020
@isoos isoos deleted the search-timeout branch March 16, 2020 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix timeout when search is down.
3 participants