Add Windows platform compatibility #4203
Open
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.
Summary
AcceptedStreamabstraction for cross-platform stream handlingBuilding on Windows
Kafka with OIDC support (via rdkafka) depends on krb5-src (Kerberos), which doesn't build on Windows - its build script requires Unix tools (
cat,sed). Rather than require Unix users to change their build process, I made Kafka opt-out for Windows users:Existing Unix builds require no changes -
cargo buildcontinues to work as before with Kafka enabled by default.Changes
Signal Handling
server/src/signal.rsinto platform-specific modulesUnix Domain Sockets
#[cfg(unix)]AcceptedStreamenum implementingAsyncRead + AsyncWritefor unified stream handlingKafka Feature
kafkaandkafka-oidcfeatures--no-default-featuresResource Limits
rlimitcalls with#[cfg(unix)]rlimitandnixcrates Unix-only dependenciesTest Infrastructure
Listeners::new_tcp_listener()for cross-platform test setuptest_http_posttest that runs on all platforms#![cfg(unix)]Feature Parity
Test plan
cargo test -p restate-types --no-default-features- 196 passcargo test -p restate-core --no-default-features- 10 passcargo test -p restate-ingress-http --no-default-features- 25 passNote: Pre-existing test isolation issues
During testing I discovered some pre-existing test isolation bugs unrelated to this PR. When running test suites together, some tests fail due to global
ConfigurationandTaskCenterstate leaking between tests. All tests pass when run individually. Examples:restate-bifrost:test_append_record_too_largesets a 5-byte record limit that persists to subsequent testsrestate-types:endpoint_manifest_options_propagation::*tests fail with incorrectjournal_retentionvaluesrestate-core:test_basic_lifecyclefails when run after other tests due to TaskCenter stateThese issues don't appear to be related to my changes.