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

Windows raising different exception since 9.2.12.0 #6322

Closed
jsvd opened this issue Jul 14, 2020 · 6 comments · Fixed by #6328
Closed

Windows raising different exception since 9.2.12.0 #6322

jsvd opened this issue Jul 14, 2020 · 6 comments · Fixed by #6328

Comments

@jsvd
Copy link
Contributor

jsvd commented Jul 14, 2020

After upgrading JRuby to 9.2.12.0 in Logstash, our CI testing is showing failures in windows

00:43:56          Failure/Error: expect { subject.run }.to raise_error(Errno::EADDRINUSE, /Logstash tried to bind to port range/)
00:43:56 
00:43:56            expected Errno::EADDRINUSE with message matching /Logstash tried to bind to port range/, got #<SystemCallError: Unknown error (SystemCallError) - bind(2) for "127.0.0.1" port 10000> with backtrace:
00:43:56              # A:/vendor/bundle/jruby/2.5.0/gems/puma-4.3.5-java/lib/puma/binder.rb:229:in `add_tcp_listener'
00:43:56              # A:/logstash-core/lib/logstash/webserver.rb:104:in `start_webserver'
00:43:56              # A:/logstash-core/lib/logstash/webserver.rb:60:in `block in run'
00:43:56              # A:/logstash-core/lib/logstash/webserver.rb:55:in `run'
00:43:56              # A:/logstash-core/spec/logstash/webserver_spec.rb:137:in `block in <main>'

Maybe related to: 55d1b31

@headius
Copy link
Member

headius commented Jul 15, 2020

Yeah pretty much definitely related to that commit.

@headius headius added this to the 9.2.13.0 milestone Jul 15, 2020
@headius
Copy link
Member

headius commented Jul 16, 2020

Any easy way to reproduce this?

@headius
Copy link
Member

headius commented Jul 16, 2020

I have a change that will fall back on the old behavior if it's not able to find a matching BindException message. That should fix this, but I can't reproduce here. Perhaps you could PR a test that exercises this?

Also, I think it would be a good idea if we set up a Logstash CI job in JRuby.

headius added a commit to headius/jruby that referenced this issue Jul 16, 2020
On some platforms, the expected BindException messages may differ,
so we need to fall back to the regexp match to make sure we do not
raise a SystemCallError.

Fixes jruby#6322
@headius
Copy link
Member

headius commented Jul 16, 2020

@jsvd I've merged #6328 but I'd really like to get confirmation that it's working. It will be in JRuby 9.2.13 very soon.

@headius headius closed this as completed Jul 16, 2020
@jsvd
Copy link
Contributor Author

jsvd commented Jul 17, 2020

@headius thanks for the quick fix. I'll setup a windows machine today, test the change and report asap.

Also, I think it would be a good idea if we set up a Logstash CI job in JRuby.

That'd be great!

In logstash we have a compatibility phase in our CI that runs a suite of tests (around 20 min) on multiple *nix and windows.

I'll bring this topic to the team to find out what's the setup we should have. In one way we want to test head jruby against head logstash, but we'll want to avoid causing jruby ci to fail due to our head being unstable.

@jsvd
Copy link
Contributor Author

jsvd commented Jul 17, 2020

I confirm the patch fixes the issue on windows. Here's a one liner that reproed the issue:

jruby-9.2.12.0:

C:\logstash\logstash-7.9.0>vendor\jruby\bin\jruby -rsocket -e "2.times { TCPServer.new('127.0.0.1', 4444) }"
2020-07-17T14:20:31.578Z [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist' to enable.
SystemCallError: Unknown error (SystemCallError) - bind(2) for "127.0.0.1" port 4444
  initialize at org/jruby/ext/socket/RubyTCPServer.java:131
         new at org/jruby/RubyIO.java:876
          -e at -e:1
      <main> at -e:1

vs jruby 9.2.12.0 + f13cf68

C:\logstash\logstash-master>vendor\jruby\bin\jruby -rsocket -e "2.times { TCPServer.new('127.0.0.1', 4444) }"
2020-07-17T14:23:12.126Z [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist' to enable.
Errno::EADDRINUSE: Address already in use - bind - Address already in use: bindbind(2) for "127.0.0.1" port 4444
  initialize at org/jruby/ext/socket/RubyTCPServer.java:131
         new at org/jruby/RubyIO.java:876
          -e at -e:1
      <main> at -e:1

enebo pushed a commit that referenced this issue Aug 31, 2020
On some platforms, the expected BindException messages may differ,
so we need to fall back to the regexp match to make sure we do not
raise a SystemCallError.

Fixes #6322
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

Successfully merging a pull request may close this issue.

2 participants