Skip to content

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

3 participants