-
Notifications
You must be signed in to change notification settings - Fork 110
ractor_cluster: Add external transport injection (ClusterBidiStream), docs + tests #391
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #391 +/- ##
==========================================
+ Coverage 82.48% 85.82% +3.34%
==========================================
Files 71 71
Lines 12918 13018 +100
==========================================
+ Hits 10655 11173 +518
+ Misses 2263 1845 -418 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is super cool! Thanks for the addition!
Any chance we could add a e2e test on the docker playground to go with it? I'm not sure how much boiler plate is required to setup a custom stream, but it would help validate that a fully setup networked node works as expected.
|
You'd need to create a new "env" for Docker to automate the test similar to this: https://github.com/slawlor/ractor/blob/main/ractor_cluster_integration_tests/envs/auth-handshake.env Then add it to the test matrix here https://github.com/slawlor/ractor/blob/main/.github/workflows/integration.yaml |
* Add `ClusterBidiStream` trait for injecting custom network transports. * Extend `NetworkStream` with an `External` variant for user-provided streams. * Implement `NodeServerMessage::ConnectionOpenedExternal` to accept new transports. * Provide `client_connect_external` helper for easy client-side integration. * Update `README.md` with detailed instructions and examples for custom transports. * Ensure full compatibility; existing TCP and TLS connections are unaffected.
8d4fa5b to
d4ecbf8
Compare
- Implemented a comprehensive end-to-end integration test for the `ractor_cluster` external transport API. - The test utilizes Docker containers to simulate a multi-node cluster, binding custom TCP listeners and dialling peers directly. - Replaced previous in-memory duplex stream tests with real TCP connections for more realistic validation. - Introduced `ExternalProbeActor` to verify remote messaging and RPC functionality over the custom transport. - Integrated the new test into the `.github/workflows/integration.yaml` CI pipeline to ensure continuous validation.
- Refactor `wait_for_session_ready` to handle authenticated-only sessions that may not fully establish or may close post-probe. - Introduce `SESSION_AUTH_GRACE_MS` to allow flexibility for authenticated but not-yet-ready sessions to complete their purpose. - Add `wait_for_remote_probe_presence` for tests where the local node discovers remote actors without establishing a full session. - Implement `wait_for_session_teardown` to verify proper session cleanup when the local node is configured to listen. - Update `ExternalProbeActor` to explicitly signal probe completion, enabling more robust session state verification. - Conditionally apply session and teardown waiting based on `config.listen_port` for diverse test scenarios.
… benches * Disambiguated `JoinHandle` types using `RactorJoinHandle` and `TokioJoinHandle` aliases for improved clarity. * Updated `spawn_external_listener` and `cleanup` signatures to use the explicit `JoinHandle` aliases in cluster integration tests. * Removed redundant `let _ =` bindings during `async-std` benchmark runtime initialization. * Replaced `|v| Some(v)` closures with direct `Some` function calls for `output_port.subscribe` in actor benchmarks. * Marked `_since` as unused in `wait_for_session_ready` destructuring for clearer intent.
|
Sry for the spam, was trying to get it done remotely. I could add other more interesting options like quic, what I'm using it for, but the boiler plate seemed a bit heavy for the moment. Thanks for all your work on this, Ractor is Awesome!! |
Overview
bidirectional byte stream.
Why
domain sockets, named pipes, or in‑memory streams.
What Changed
local_label.
Backwards Compatibility
API Summary
is_server: bool }
Usage
is_server: true/false })?;
Tests
Implementation Notes
NodeServerSessionInformation.peer_addr.
writes.
(net, io-util).
Follow‑ups (Out of Scope Here)
delta.
Checklist
Touched Files (high level)