Skip to content

Conversation

Watson1978
Copy link
Contributor

Fix #103

@Watson1978
Copy link
Contributor Author

Hmm, looks like the socket settings created with Socket.tcp different...

@@ -21,6 +21,8 @@ Gem::Specification.new do |gem|
gem.require_paths = ['lib']
gem.license = "Apache-2.0"

gem.required_ruby_version = '>= 3.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems TCPSocket.new supports connect_timeout and resolv_timeout since Ruby 3.0
https://github.com/ruby/ruby/blob/v3_0_0/ext/socket/tcpsocket.c#L23-L51

Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 marked this pull request as ready for review July 18, 2025 08:08
@daipom daipom self-requested a review July 18, 2025 08:11
@Watson1978
Copy link
Contributor Author

@daipom @kenhys Can you please review this PR ?

Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

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

Thanks so much for this improvement!

Looks good to me about adding connect_timeout option.

About resolv_timeout, I have some concerns, and commented below.
Could you please check it?

Signed-off-by: Shizuo Fujita <[email protected]>
Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 changed the title Add connect_timeout / resolve_timeout option Add timeout option Aug 9, 2025
@daipom daipom self-requested a review September 1, 2025 07:24
Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for my late response.

There are concerns about exiting socket operations with Timeout, but the advantage is that it doesn’t require limiting the Ruby version.
It’s disabled by default, so if any issues arise, we can consider fixing them then.

@daipom daipom merged commit 9e329d1 into fluent:master Sep 1, 2025
4 checks passed
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.

Setting socket timeouts
2 participants