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

uds: add exponential backoff write timeout #307

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

iksaif
Copy link
Contributor

@iksaif iksaif commented May 24, 2024

In order to avoid overloading the agent this gradually increase the writeTimeout up to the connectTimeout.

For uds-stream this will also reduce the re-connection rate when the agent is too slow to ingest all the packets, which is important because each new connection comes with a relatively big socket buffer.

@iksaif iksaif requested a review from a team as a code owner May 24, 2024 11:43
incr = time.Millisecond * 500
}
w.currentWriteTimeout += incr
if w.currentWriteTimeout > w.connectTimeout {
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumes that connection timeout is larger than the write timeout, although this might not be always the case. Would it make sense to ensure that connectTimeout is at least as big as writeTimeout, or perhaps use a separate upper bound?

@iksaif iksaif changed the title uds: add exponential backoff for reconnect uds: add exponential backoff write timeout May 28, 2024
@iksaif iksaif marked this pull request as draft May 28, 2024 11:29
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.

2 participants