THRIFT-6079: Add Rack HTTP server support for Ruby#3634
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds modern Rack-based HTTP server support for the Ruby Thrift library, decoupling HTTP request handling from legacy servers while expanding cross-language HTTP/HTTPS integration coverage.
Changes:
- Introduces
Thrift::RackApplicationand refactorsThrift::ThinHTTPServerto delegate to it (with a deprecation warning), removing the Mongrel HTTP server. - Extends the Ruby cross-test integration harness to run HTTP/HTTPS servers via Thin, Puma, and Falcon, and enables the Ruby HTTP client in cross-language HTTP tests (including CA file support).
- Updates CI/cross-test configuration and Ruby documentation to reflect the new HTTP/Rack approach and Ruby version used for cross-tests.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/tests.json | Adds Ruby HTTP client transport and new Ruby HTTP server variants (thin/puma/falcon) for cross-tests. |
| test/rb/integration/TestServer.rb | Adds rack-backed HTTP server modes and TLS setup for Thin/Puma/Falcon in the Ruby integration server. |
| test/rb/integration/TestClient.rb | Adds HTTP client transport support (including TLS CA file) and skips oneway timing assertions for HTTP. |
| test/rb/Gemfile | Adds Puma and Falcon dependencies for integration harness HTTP server coverage. |
| test/rb/Gemfile.lock | Locks the new Ruby test harness dependencies (Puma/Falcon and their transitive deps). |
| test/known_failures_Linux.json | Records expected cross-test failures for HTTP over domain sockets / known HTTP matrix gaps. |
| lib/rb/spec/thin_http_server_spec.rb | Updates Thin HTTP server specs for deprecation warning, Rack delegation, and SSL option wiring. |
| lib/rb/spec/rack_application_spec.rb | Adds specs for the new Thrift::RackApplication Rack endpoint behavior. |
| lib/rb/spec/http_client_spec.rb | Adds spec coverage for ssl_ca_file handling in the Ruby HTTP client transport. |
| lib/rb/README.md | Documents Rack/Rails mounting APIs and notes Thin deprecation + Mongrel removal for 0.25.0. |
| lib/rb/lib/thrift/transport/http_client_transport.rb | Adds ssl_ca_file support to HTTPS requests. |
| lib/rb/lib/thrift/server/thin_http_server.rb | Deprecates Thin HTTP server, delegates request processing to shared Rack application, adds SSL wiring. |
| lib/rb/lib/thrift/server/rack_application.rb | Introduces shared Rack endpoint implementation for Ruby HTTP request processing. |
| lib/rb/lib/thrift/server/mongrel_http_server.rb | Removes legacy Mongrel HTTP server implementation. |
| .github/workflows/build.yml | Updates cross-test matrix to include rb.thin/rb.puma/rb.falcon and switches Ruby cross-test version to 4.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Client: rb Co-Authored-By: OpenAI Codex (GPT-5.4) <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruby HTTP server support has historically been coupled to Thin and Mongrel. Mongrel no longer works with supported Ruby versions, while Thin is inactive and its EventMachine dependency does not compile on Ruby development versions targeting Ruby 4.1.
This change extracts Thrift HTTP request processing into
Thrift::RackApplication. It can run as a standalone Rack application or be mounted at a route inside an existing Rack application such as Rails. The Rack host remains responsible for listening, concurrency, lifecycle, and TLS configuration.Thrift::ThinHTTPServernow delegates to the shared Rack application and emits a deprecation warning. Thin remains available for compatibility and continues to be covered by cross-language tests.Thrift::MongrelHTTPServeris removed.The Ruby integration harness now exercises HTTP and HTTPS with Thin, Puma, and Falcon. The Ruby HTTP client also participates in cross-language HTTP tests and accepts
ssl_ca_filefor verification against test or private certificate authorities. Cross-tests use Ruby 4.0 rather than the oldest supported Ruby version, this is to allow us to test against Falcon (requires 3.3+).The Ruby README documents the Rack and Rails mounting APIs and records the Thin deprecation and Mongrel removal for the 0.25.0 release.
Caveats
ONEWAYcalls receive no special asynchronous handling. The processor completes inside the Rack request before the HTTP response is returned, preserving the historical Thin behavior. No detached threads, Rack hijacking, or server-specific async APIs are introduced. Cross-tests that enforce fire-and-forget timing are recorded as known failures; the processing model can be reconsidered separately.Thrift::RackApplication; this does not introducePumaHTTPServerorFalconHTTPServerwrapper classes. Applications configure and operate those servers normally.[skip ci]anywhere in the commit message to free up build resources.