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 Socket.tcp connect_timeout option #4061

Merged
merged 1 commit into from
Aug 11, 2016

Conversation

etehtsea
Copy link
Contributor

@etehtsea etehtsea commented Aug 10, 2016

Before commit Socket.tcp(host, port, connect_timeout: 0.1)
ignored timeout option. This happened because connect_internal
mistakenly responded with :wait_readable instead :wait_writable.
After fixing it this code started to constantly fail with timeout error.
Checking for OP_CONNECT in IO#wait_writable fixed this issue.

Added adopted spec from MRI, because it's excluded by other reasons.

@eregon
Copy link
Member

eregon commented Aug 10, 2016

Just curious, why did you close the spec and added a jruby-specific test instead?
The spec would benefit other Ruby implementations.

@etehtsea
Copy link
Contributor Author

@eregon ruby/spec#279 fixed

Before commit `Socket.tcp(host, port, connect_timeout: 0.1)`
ignored timeout option. This happened because `connect_internal`
mistakenly responded with `:wait_readable` instead of `:wait_writable`.
After fixing it this code started to constantly fail with timeout error.
Checking for OP_CONNECT in IO#wait_writable fixed this issue.
@etehtsea etehtsea force-pushed the fix-connect-timeout branch from f598ef8 to dcf4571 Compare August 10, 2016 11:56
@enebo enebo merged commit 8fddbaf into jruby:master Aug 11, 2016
@enebo enebo added this to the JRuby 9.1.3.0 milestone Aug 11, 2016
@enebo enebo added the core label Aug 11, 2016
@etehtsea etehtsea deleted the fix-connect-timeout branch August 11, 2016 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants