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

JRuby build failures #1982

Closed
nateberkopec opened this issue Sep 23, 2019 · 6 comments
Closed

JRuby build failures #1982

nateberkopec opened this issue Sep 23, 2019 · 6 comments

Comments

@nateberkopec
Copy link
Member

Luckily I think it's failing in the same place each time

@hahmed
Copy link
Contributor

hahmed commented Nov 18, 2019

In jruby 9.2.9.0 the tests are failing in both places related to SSL
TestCLI#test_control_for_ssl
TestPumaControlCli#test_control_ssl

Here are some of the error messages I got back for the CLI -- when I managed to get the tests to complete, in most cases the tests just hang;

TestCLI#test_control_for_ssl:
OpenSSL::SSL::SSLError: Connection reset by peer
    org/jruby/ext/openssl/SSLSocket.java:276:in `connect_nonblock'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/protocol.rb:44:in `ssl_socket_connect'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/http.rb:985:in `connect'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/http.rb:924:in `do_start'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/http.rb:913:in `start'
    /Users/haroon/projects/puma/test/test_cli.rb:94:in `test_control_for_ssl'

on a different test run I got another error for the same test;

TestCLI#test_control_for_ssl:
Net::OpenTimeout: Net::OpenTimeout
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/protocol.rb:41:in `ssl_socket_connect'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/http.rb:985:in `connect'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/http.rb:924:in `do_start'
    /Users/haroon/.asdf/installs/ruby/jruby-9.2.9.0/lib/ruby/stdlib/net/http.rb:913:in `start'
    /Users/haroon/projects/puma/test/test_cli.rb:94:in `test_control_for_ssl

PumaControlCLI

TestPumaControlCli#test_control_ssl
Error in reactor loop escaped: closed stream (IOError)
org/jruby/RubyIO.java:3071:in `read'
org/jruby/RubyIO.java:3053:in `read'
/Users/haroon/projects/puma/lib/puma/reactor.rb:160:in `block in run_internal'
org/jruby/ext/thread/Mutex.java:164:in `synchronize'
/Users/haroon/projects/puma/lib/puma/reactor.rb:159:in `block in run_internal'
org/jruby/RubyArray.java:1814:in `each'
/Users/haroon/projects/puma/lib/puma/reactor.rb:157:in `run_internal'
/Users/haroon/projects/puma/lib/puma/reactor.rb:313:in `block in run_in_thread'
Exception handling servers: closed stream (IOError)
org/jruby/RubyIO.java:1469:in `write'
org/jruby/RubyIO.java:1439:in `write'
org/jruby/RubyIO.java:2642:in `write'
org/jruby/RubyIO.java:2485:in `puts'
:1:in `'
:1:in `'
Exception handling servers: closed stream (IOError)
org/jruby/RubyIO.java:1469:in `write'
org/jruby/RubyIO.java:1439:in `write'
org/jruby/RubyIO.java:2642:in `write'
org/jruby/RubyIO.java:2485:in `puts'
:1:in `'
:1:in `'
warning: thread "Ruby-0-Thread-153: /Users/haroon/projects/puma/test/test_pumactl.rb:163" terminated with exception (report_on_exception is true):
IOError: closed stream
  write at org/jruby/RubyIO.java:1469
  write at org/jruby/RubyIO.java:1439
  write at org/jruby/RubyIO.java:2642
   puts at org/jruby/RubyIO.java:2485
        at :1
        at :1
Exception in thread "Ruby-0-Thread-153: /Users/haroon/projects/puma/test/test_pumactl.rb:163" java.lang.NullPointerException
	at org.jruby.dist/org.jruby.internal.runtime.ThreadService.getMainThread(ThreadService.java:232)
	at org.jruby.dist/org.jruby.RubyThread.exceptionRaised(RubyThread.java:1823)
	at org.jruby.dist/org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:112)
	at java.base/java.lang.Thread.run(Thread.java:834)
rake aborted!
Command failed with status (1)

@hahmed
Copy link
Contributor

hahmed commented Nov 18, 2019

re: TestPumaControlCli#test_control_ssl

More specifically the ssl test fails when it hits the capture_subprocess_io method i.e.

def assert_command_cli_output(options, expected_out)
    cmd = Puma::ControlCLI.new(options)
    out, _ = capture_subprocess_io do
      cmd.run
    end
    assert_match expected_out, out
  end

I inspected the cmd variable below;

#<Puma::ControlCLI:0x79080255 @control_auth_token="ctrl", @cli_options={}, @pidfile=nil, @state=nil, @quiet=false, @argv=["--control-url", "ssl://127.0.0.1:65347?keystore=/Users/haroon/projects/puma/examples/puma/keystore.jks&keystore-pass=pswd&ssl_cipher_list=TLS_DHE_RSA_WITH_DES_CBC_SHA,TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", "--control-token", "ctrl", "--config-file", "test/config/app.rb", "status"], @pid=nil, @stdout=#<IO:<STDOUT>>, @config_file="test/config/app.rb", @environment="production", @command="status", @control_url="ssl://127.0.0.1:65347?keystore=/Users/haroon/projects/puma/examples/puma/keystore.jks&keystore-pass=pswd&ssl_cipher_list=TLS_DHE_RSA_WITH_DES_CBC_SHA,TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", @stderr=#<IO:<STDERR>>>

@composerinteralia
Copy link
Contributor

Those test were added in #2046 and #2052, if that helps at all.

Those were both added after this issue was opened, so they might not be what this issue was originally about, but definitely still a good find.

@hahmed
Copy link
Contributor

hahmed commented Nov 19, 2019

I commended/skipped the aforementioned tests as an experiment and here is the PR: #2077 and TravisCI passed too https://travis-ci.org/puma/puma/builds/614214871

17 min test is like forever 😂 it's only a few annoying tests that take so long, prob could do with some optimising. With regards to those failed tests, I did have a look into fixing it for jruby but could not find a clear solution, the only conclusion I came up with SSL on jruby is not working, I could not find a single working test for jruby using SSL, correct me if I'm wrong...?

@hahmed
Copy link
Contributor

hahmed commented Nov 23, 2019

I wonder if this is related? socketry/nio4r#201

@nateberkopec
Copy link
Member Author

JRuby LGTM now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants