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

Graphite: implement connection & socket timeout #4313

Closed

Conversation

dolfinus
Copy link

Graphite class methods does not have any explicit timeout. So when Graphite instance is not available, experiencing network issues or is overloaded with too many requests, reporter may hang for some long time.

In my case (Spark metrics sink sending reports to Graphite) the lack of timeouts prevents Spark session from being stopped if Graphite instance is overloaded. This can last 5-10 minutes, sometimes even more.

What's changed:

  • Add connectionTimeoutMs argument to Graphite constructor (default 500ms)
  • Add socketTimeoutMs argument to Graphite constructor (default 5s)

@dolfinus dolfinus requested review from a team as code owners July 30, 2024 15:43
@dolfinus dolfinus closed this Jul 30, 2024
@dolfinus dolfinus deleted the feature/graphite-timeout branch July 30, 2024 15:57
@dolfinus
Copy link
Author

Closed because socket.setSoTimeout(...) can be used only to set timeout of read operations, but not write operations which are used by this sender. Java sockets don't support timeout for write operations at all. The only way to implement this is using some kind of non-blocking IO.

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.

1 participant