Skip to content
This repository has been archived by the owner. It is now read-only.

Ruby selenium-webdriver should catch Errno::EBADF #1611

Closed
lukeis opened this issue Mar 2, 2016 · 3 comments

Comments

@lukeis
Copy link
Member

commented Mar 2, 2016

Originally reported on Google Code with ID 1611

Linux can sometimes raise Errno::EBADF on TCPServer.new. This is relevant in the SocketLock
class - this exception is not rescued to indicate that the lock could not be obtained.
Typically this occurs when many processes are trying to access the lock at the same
time.

What steps will reproduce the problem?
1. On linux, run this script: https://gist.github.com/ec9a6d708780e951146f

It is a minimal extraction of the offending code, with concurrency ramped up to practically
guarantee a replication.

What is the expected output? What do you see instead?
No exception, selenium should continue waiting on the lock. Instead the following exception
is raised:

     Errno::EBADF:
       Bad file descriptor
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/socket_lock.rb:57:in
`initialize'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/socket_lock.rb:57:in
`new'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/socket_lock.rb:57:in
`can_lock?'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/socket_lock.rb:43:in
`lock'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/socket_lock.rb:29:in
`locked'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/launcher.rb:32:in
`launch'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/firefox/bridge.rb:21:in
`initialize'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/common/driver.rb:27:in
`new'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver/common/driver.rb:27:in
`for'
     # /var/lib/jenkins/gems/ruby/1.9.1/gems/selenium-webdriver-0.1.2/lib/selenium/webdriver.rb:73:in
`for'



What version of the product are you using? On what operating system?
selenium-webdriver-0.1.2, though the issue is also present in 0.2.0

Recommended fix: Add Errno::EBADF to the list of rescued exceptions alongside SocketError
and Errno::EADDRINUSE.

Reported by hello@xaviershay.com on 2011-04-30 00:39:21

@lukeis

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2016

Fixed in r12091.

Reported by jari.bakken on 2011-04-30 11:39:37

  • Status changed: Fixed
@lukeis

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2016

Can someone update the broken link for r12091?

Reported by dharcsztark@jibe.com on 2015-06-25 16:31:02

@lukeis

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:12:40

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this Mar 2, 2016

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant
You can’t perform that action at this time.