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

feat: Bits and bobs to fulfil complete Rack compliant #946

Open
4 tasks
ayushn21 opened this issue Nov 26, 2024 · 1 comment
Open
4 tasks

feat: Bits and bobs to fulfil complete Rack compliant #946

ayushn21 opened this issue Nov 26, 2024 · 1 comment
Assignees
Milestone

Comments

@ayushn21
Copy link
Member

Summary

With Bridgetown v2.0, we added the rackup gem instead of instantiating Puma directly. This paved the way for the user to swap web server.

There are still a couple of issues to resolve before we can claim to be fully Rack compliant and support all Rack web servers. This issue tracks the remaining work.

Motivation

There's no reason not to. We inherited a dependency on WEBrick from Jekyll, and replaced it with Puma. A step in the right direction, but we should go all the way. Roda is Rack-compliant. There's no technical reason for Bridgetown not to be.

Checklist

  • Ensure Bridgetown can be started with bundle exec puma and bundle exec falcon serve.
  • A user should be able to setup Falcon easily. We should offer an out of the box setup in the future, but one step at a time.
  • Remove the require "puma" dependency in the console command:
  • Ensure the live dev reload code works with all web servers.
@ayushn21
Copy link
Member Author

The error with the live dev reload code when using Falcon:

   # | Task may have ended with unhandled exception.
   # |   Errno::EPIPE: Broken pipe
   # |   → <internal:io> 121:in `write_nonblock'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/io-stream-0.6.1/lib/io/stream/buffered.rb:93 in `syswrite'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/io-stream-0.6.1/lib/io/stream/generic.rb:184 in `drain'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/io-stream-0.6.1/lib/io/stream/generic.rb:196 in `block in flush'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/io-stream-0.6.1/lib/io/stream/generic.rb:195 in `synchronize'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/io-stream-0.6.1/lib/io/stream/generic.rb:195 in `flush'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/protocol-http1-0.28.1/lib/protocol/http1/connection.rb:508 in `block in write_chunked_body'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/protocol-http-0.45.0/lib/protocol/http/body/readable.rb:86 in `each'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/protocol-http1-0.28.1/lib/protocol/http1/connection.rb:501 in `write_chunked_body'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/protocol-http1-0.28.1/lib/protocol/http1/connection.rb:590 in `write_body'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-http-0.84.0/lib/async/http/protocol/http1/server.rb:133 in `block in each'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-2.21.0/lib/async/task.rb:327 in `defer_stop'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-http-0.84.0/lib/async/http/protocol/http1/server.rb:80 in `each'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-http-0.84.0/lib/async/http/server.rb:50 in `accept'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/io-endpoint-0.14.0/lib/io/endpoint/wrapper.rb:182 in `block (2 levels) in accept'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-2.21.0/lib/async/task.rb:197 in `block in run'
   # |     /Users/ayush/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-2.21.0/lib/async/task.rb:435 in `block in schedule'

It's something to do with threading .... we shouldn't make assumptions about how Bridgetown will be deployed. We need to find a better way to keep the persistent connection open without breaking the web server.

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