Repository navigation
Conversation
Gate connect(address, { protocol: 'udp' }) and Uint8Array value streams
behind outbound_udp_sockets. Preserve the existing TCP defaults and
legacy UDP ingress behavior for Workers without the flag. Stable type
snapshots remain unchanged; the new options are experimental only.
Route UDP setup and datagrams through owning RPC capabilities, respect
Durable Object output gates, and implement the standalone Rust network
backend with destination resolution and PeerFilter checks. Preserve
empty packets, sliced buffers, byte snapshots and close draining.
Include runtime libraries in type generation and reject startup failure.
Add collector E2E and API/type coverage for both stream implementations.
Relevant suites pass five runs, including local 9000-byte packets.
External DNS and send-only receipt checks pass at smaller payloads;
network paths and embedding backends can impose tighter size limits.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8140 +/- ##
==========================================
- Coverage 68.85% 68.83% -0.03%
==========================================
Files 745 748 +3
Lines 194951 195462 +511
Branches 30272 30327 +55
==========================================
+ Hits 134234 134542 +308
- Misses 42936 43123 +187
- Partials 17781 17797 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fork pull requests cannot use Bazelflare's OIDC credentials and run their tools on the GitHub runner. The pinned x64 clang-tidy binary requires glibc 2.38, so the Ubuntu 22.04 fallback fails before checks can execute. Use the standard Ubuntu 24.04 runner for this fallback. Preserve the configured runners for trusted builds and other architectures, and keep required job names unchanged. Validated the reusable workflow and its callers with actionlint.
Fork jobs do not receive BAZEL_CACHE_KEY, but still attempt to upload local results. The cache rejects these uploads, and an interrupted HTTP response can crash Bazel with PrematureChannelClosureException (exit 37). Disable uploads when the credential is absent, retaining public cache reads. Authenticated jobs keep their existing behavior, and bazelflare continues to use its own cache and executor configuration. Validate the workflow with actionlint and exercise all eight combinations of cache credentials, OIDC availability and requested execution backend. See bazelbuild/bazel#32092.
Use an acknowledged RPC call for outbound datagrams so each write waits for the backend result. Streaming calls can otherwise report success before transport validation rejects the packet. Preserve the existing streaming path for ingress UDP. Add a delayed transport failure regression test and document local send completion.
Keep the compatibility flags allocated upstream and move the draft outbound UDP flag to ordinal 204. This restores a mergeable PR so the standard CI workflows can test its merge revision. Upstream now selects Ubuntu 24 for Linux jobs, so drop the draft's older runner override. Keep the read-only cache setting for forks.
Explain per-datagram limits and distinguish the native backend's ceiling from embedding limits. Document how a rejected write errors the writable stream and how applications can validate before writing to keep a socket reusable. Preserve the original write error during cleanup in the send-only example.
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.
User stories affected or enabled by this change
Workers and Durable Objects can send and receive outbound UDP datagrams, including send-only applications that write and close without waiting for a reply.
For example, a Worker can open a fixed UDP destination, write one
Uint8Arrayper datagram, and read response datagrams when its protocol needs them. Successful writes mean local backend submission, not peer acknowledgement or delivery.APIs/interfaces created, changed, or removed
connect(address, { protocol: 'udp' })underoutbound_udp_sockets; TCP remains the default.Uint8Arraydatagrams to one fixed destination.Uint8Arrayvalues.The internal embedding companion is Edgeworker !15871.
Architecture choices and reasoning
UDP has no connection handshake. Await each packet's backend result so immediate write errors reach the caller, and retain normal WritableStream failure behavior. Integrate Durable Object output gates; unsupported embedding backends reject explicitly.
The standalone implementation accepts payloads up to 65,507 bytes, which is neither a network delivery guarantee nor an embedding limit. Edgeworker's companion has a separate 1,500-byte backend cap. Stable type snapshots remain unchanged. Type generation includes runtime libraries and fails on startup errors instead of accepting an empty snapshot.
Validation and launch boundary
Recorded qualification includes five repeated Worker/DO collector E2E runs, C++ socket tests, ingress regressions, both stream implementations, TypeScript usage, output gates, policy, snapshot/cleanup, and delayed RPC cases. Local collectors verified empty/binary/sliced 9,000-byte payloads and close/reply behavior. External tests recorded 20 DNS responses and 60 send-only receipts; external large-payload delivery is not claimed because path limits also affect native UDP.
This remains an experimental API/backend draft. See
docs/outbound-udp.md; review the embedding and production rollout separately.