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

Fix excessive client connection creation #40

Merged
merged 5 commits into from
May 25, 2023

Conversation

VincentYe123
Copy link
Contributor

This PR description discusses an issue where each RPC request calls ResolveNow. Due to incorrect handling of this event, a new connection is created for every request. As concurrency increases, so does the number of required connections, leading to timeouts on both the client and server sides when establishing connections.

@sercand sercand merged commit 838b0bc into sercand:master May 25, 2023
period *= 2
} else {
period = initialPeriod
}

Choose a reason for hiding this comment

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

this seems.... odd to me. Am I reading this right? This seems like it would wait:

1s, 2s, 4s, 8s, 16s, 1s, 2s, 4s, 8s, 16s, 1s, 2s, 4s, 8s, 16s....

Choose a reason for hiding this comment

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

Generally when I write things like this, what you want is some signal of success or failure from f(). As long as f errors you backoff from initial -> max. Whenever f succeeds you reset back to initial. A reasonable signal in this particular case might be "If I got an EOF that was a successful connection that terminated eventually; if I got a different kind of error that was a failure to connect"

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