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

Regression with TCPSocket#close_on_exec on windows #4910

Closed
ketan opened this issue Dec 20, 2017 · 2 comments
Closed

Regression with TCPSocket#close_on_exec on windows #4910

ketan opened this issue Dec 20, 2017 · 2 comments

Comments

@ketan
Copy link
Member

ketan commented Dec 20, 2017

After upgrading from jruby 9.1.14.0 to 9.1.15.0 we have realized that the upgrade seems to have caused a regression with TCPSocket#close_on_exec (see #4858)

This causes selenium-webdriver (3.7.0) and childprocess (0.8.0) to not work as before...

https://github.com/SeleniumHQ/selenium/blob/selenium-3.7.0/rb/lib/selenium/webdriver/common/socket_lock.rb#L61-L62

https://github.com/enkessler/childprocess/blob/0bce27d3f84ffac06ee49aa4dcb9ce8608cc49d3/lib/childprocess.rb#L153-L156

This combination raises an exception (on windows) —

NotImplementedError: fcntl unsupported or native support failed to load; see http://wiki.jruby.org/Native-Libraries
org/jruby/RubyIO.java:2206:in `close_on_exec='
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/childprocess-0.8.0/lib/childprocess.rb:155:in `close_on_exec'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/socket_lock.rb:62:in `can_lock?'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/socket_lock.rb:50:in `lock'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/socket_lock.rb:36:in `locked'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:69:in `start'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/ie/driver.rb:51:in `initialize'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/driver.rb:42:in `for'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver.rb:84:in `for'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/spec/javascripts/support/jasmine_with_selenium_runner.rb:25:in `initialize'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/spec/javascripts/support/jasmine_helper.rb:41:in `block in (root)'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/jasmine-2.8.0/lib/jasmine/ci_runner.rb:20:in `run'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/jasmine-2.8.0/lib/jasmine/tasks/jasmine.rake:55:in `block in (root)'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/task.rb:251:in `block in execute'
org/jruby/RubyArray.java:1735:in `each'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/task.rb:251:in `execute'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
C:/go-agent-17.11.0/pipelines/build-windows-PR/tools/jruby/lib/ruby/stdlib/monitor.rb:214:in `mon_synchronize'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/task.rb:188:in `invoke_with_call_chain'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/task.rb:181:in `invoke'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:160:in `invoke_task'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:116:in `block in top_level'
org/jruby/RubyArray.java:1735:in `each'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:116:in `block in top_level'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:125:in `run_with_threads'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:110:in `top_level'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:83:in `block in run'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:186:in `standard_exception_handling'
C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/rake-12.2.1/lib/rake/application.rb:80:in `run'
./bin/rake:4:in `<main>'
Tasks: TOP => jasmine:ci
NoMethodError: undefined method `poll_for_exit' for nil:NilClass
                stop at C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:78
      block in start at C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:67
  block in exit_hook at C:/go-agent-17.11.0/pipelines/build-windows-PR/server/webapp/WEB-INF/rails.new/vendor/bundle/jruby/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/platform.rb:136
@headius
Copy link
Member

headius commented Jan 24, 2018

More fallout from defining O_CLOEXEC but not having it fully supported along all paths.

I think IO#close_on_exec= should at worst silently fail to set the flag.

@headius
Copy link
Member

headius commented Jan 24, 2018

Masked out Windows in close_on_exec= for now.

@headius headius closed this as completed Jan 24, 2018
@headius headius added this to the JRuby 9.1.16.0 milestone Jan 24, 2018
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

No branches or pull requests

2 participants