-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[rb] Waiting till Socket connection completed #6909
Conversation
After `select` we should use `getsockopt` to read the SO_ERROR option at level SOL_SOCKET to determine that connection completed successfully http://man7.org/linux/man-pages/man2/connect.2.html
This is reason why I all time get error
and can't run Ruby on Rails system tests on WSL. |
While I believe this PR is technically more correct, I fail to see how it fixes any Errno::ECONNREFUSED issue you're having? |
selenium/rb/lib/selenium/webdriver/common/socket_poller.rb Lines 79 to 82 in 361c731
Errno::EINPROGRESS error means that connection in progress and we need to check status to make a decision. We check that socked is writable via IO.select and retry connection. But connection is not ready and next we got Errno::EALREADY error.
It was caught by selenium/rb/lib/selenium/webdriver/common/socket_poller.rb Lines 84 to 89 in 361c731
So listening? returns true . That allow commands by webdriver. But connection still not ready and finally we got Errno::ECONNREFUSED that not handled.
|
Now we check selenium/rb/lib/selenium/webdriver/common/socket_poller.rb Lines 90 to 94 in 361c731
So listening? returns false and listening? is retry with new connection in with_timeout block.selenium/rb/lib/selenium/webdriver/common/socket_poller.rb Lines 38 to 40 in 361c731
|
Ok - makes sense -- do you have time to fix the conflicts here so it's mergeable? |
# Conflicts: # rb/lib/selenium/webdriver/common/socket_poller.rb
Done. But after merge I found other problem #7010 |
Thanks. |
After
select
we should usegetsockopt
to read the SO_ERROR option atlevel SOL_SOCKET to determine that connection completed successfully. Otherwise in
connect_nonblock
we can get EISCONN error.http://man7.org/linux/man-pages/man2/connect.2.html
X
in the preceding checkbox, I verify that I have signed the Contributor License AgreementThis change is