socketry / falcon

A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
https://socketry.github.io/falcon/
MIT License
2.54k stars 79 forks source link

LocalJumpError after migration to 0.45.1 #247

Open neonaddict opened 3 weeks ago

neonaddict commented 3 weeks ago

After migration to version 0.45.1 with this configuration:

# falcon.rb

require "falcon/environment/rack"
require "falcon/environment/supervisor"

service "accounts_app" do
  include Falcon::Environment::Rack

  count 4

  preload "preload.rb"

  endpoint Async::HTTP::Endpoint.parse("tcp://0.0.0.0:80")
end

service "supervisor" do
  include Falcon::Environment::Supervisor
end

I'm getting this error:

/usr/local/bundle/gems/async-io-1.36.1/lib/async/io/endpoint.rb:90:in `block in bound': no block given (yield) (LocalJumpError)
        from /usr/local/bundle/gems/async-http-0.61.0/lib/async/http/endpoint.rb:196:in `block in each'
        from /usr/local/bundle/gems/async-io-1.36.1/lib/async/io/host_endpoint.rb:75:in `block in each'
        from /usr/local/lib/ruby/3.2.0/socket.rb:231:in `each'
        from /usr/local/lib/ruby/3.2.0/socket.rb:231:in `foreach'
        from /usr/local/bundle/gems/async-io-1.36.1/lib/async/io/host_endpoint.rb:74:in `each'
        from /usr/local/bundle/gems/async-http-0.61.0/lib/async/http/endpoint.rb:195:in `each'
        from /usr/local/bundle/gems/async-io-1.36.1/lib/async/io/endpoint.rb:86:in `bound'
        from /usr/local/bundle/gems/falcon-0.45.1/lib/falcon/service/server.rb:41:in `block in start'
        from /usr/local/bundle/gems/async-2.6.5/lib/async/task.rb:160:in `block in run'
        from /usr/local/bundle/gems/async-2.6.5/lib/async/task.rb:330:in `block in schedule'

I also tried to define endpoint with block, but it's getting nowhere and I'm banging my head with this issue for two days:

endpoint do
  Async::HTTP::Endpoint.parse("tcp://0.0.0.0:80")
end

What am I missing?

ioquatix commented 3 weeks ago

Thanks for your report, let me take a look today.

ioquatix commented 3 weeks ago

async-io is no longer maintained or used in Falcon.

Are you able to update to falcon v0.47.6? You should also drop the dependency on async-io (the version you are using is quite old too).