Add JEP 380 Unix Domain Sockets with production-ready IPC helpers#9175
Open
CufeHaco wants to merge 1 commit intojruby:masterfrom
Open
Add JEP 380 Unix Domain Sockets with production-ready IPC helpers#9175CufeHaco wants to merge 1 commit intojruby:masterfrom
CufeHaco wants to merge 1 commit intojruby:masterfrom
Conversation
Implements native JEP 380 (JDK 16+) Unix Domain Sockets with automatic fallback to JNR for JDK 11-15. Includes production-ready IPC helper system with auto-cleanup, auto-reconnect, connection pooling, and signal handling. Provides 20-30% performance improvement on modern JDKs with zero breaking changes. Core Implementation: - Modified 4 core socket classes (RubyUNIXSocket, RubyUNIXServer, RubyTCPSocket, RubyTCPServer) - Added 14 channel implementation files with factory pattern - Automatic runtime backend selection (JEP 380 vs JNR) - Maintains full MRI Ruby socket API compatibility IPC Helper System (socket.rb): - unix_server() / unix_client() - High-level Unix socket helpers - tcp_server() / tcp_client() - High-level TCP socket helpers - tcp_pool() - Connection pooling for high-frequency operations - Auto-cleanup of stale socket files - Auto-reconnect with exponential backoff (configurable retries) - Signal handling (INT, TERM) with graceful shutdown - Built-in SHUTDOWN command for remote server control - Thread-safe connection pool with statistics Architecture: - UnixSocketChannelFactory: Auto-selects JDK 16+ native or JNR fallback - TCPSocketChannelFactory: Handles plain/SSL socket selection - Interface-based design for extensibility - JRubySockets module with Server, Client, TCPServer, TCPClient, ConnectionPool classes Performance: 20-30% improvement on JDK 16+ compared to JNR-only implementation Documentation: Comprehensive guide in JEP380_SOCKETS.md covering usage, architecture, performance benchmarks, and migration guide. Authored-By: Troy Mallory (CufeHaco) <redeagleteam2005@gmail.com>
Contributor
Author
|
@headius @enebo this one is ready for testing and review. i had some issues with Claude and the push, so hopfully my code base didnt get changed or nothing left out. i ran though and I didn't see anything missing, but as always, please double check behind me. you can blame the electrician in me for constantly testing and checking behind myself. |
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.
Implements native JEP 380 (JDK 16+) Unix Domain Sockets with automatic
fallback to JNR for JDK 11-15. Includes production-ready IPC helper system
with auto-cleanup, auto-reconnect, connection pooling, and signal handling.
Provides 20-30% performance improvement on modern JDKs with zero breaking changes.
Core Implementation:
IPC Helper System (socket.rb):
Architecture:
Performance: 20-30% improvement on JDK 16+ compared to JNR-only implementation
Documentation: Comprehensive guide in JEP380_SOCKETS.md covering usage,
architecture, performance benchmarks, and migration guide.
Authored-By: Troy Mallory (CufeHaco) redeagleteam2005@gmail.com