Skip to content

[runtime/network] poison sink/stream on error and cancellation#3501

Open
andresilva wants to merge 13 commits intomainfrom
andre/runtime-network-poison-on-error
Open

[runtime/network] poison sink/stream on error and cancellation#3501
andresilva wants to merge 13 commits intomainfrom
andre/runtime-network-poison-on-error

Conversation

@andresilva
Copy link
Copy Markdown
Member

@andresilva andresilva commented Mar 30, 2026

This PR changes the network Sink/Stream contract so each half is poisoned after cancellation or its first I/O error instead of being implicitly reusable in an incosistent state. A failed send now makes the Sink unusable, and a failed recv makes the Stream unusable, subsequent operations on that same half return Closed, while the opposite direction can still continue.

Related #2596 (possibly closes it?)

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: b9a1b69
Status: ✅  Deploy successful!
Preview URL: https://41a8e909.monorepo-eu0.pages.dev
Branch Preview URL: https://andre-runtime-network-poison.monorepo-eu0.pages.dev

View logs

@andresilva andresilva moved this to Ready for Review in Tracker Mar 30, 2026
@andresilva andresilva self-assigned this Mar 30, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp b9a1b69 Apr 03 2026, 01:49 PM

@andresilva andresilva marked this pull request as ready for review March 30, 2026 15:07
@andresilva andresilva force-pushed the andre/runtime-network-poison-on-error branch from 5a7a281 to 3481b97 Compare March 30, 2026 16:07
@patrick-ogrady patrick-ogrady linked an issue Mar 31, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member Author

@andresilva andresilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mock changes lgtm

@andresilva andresilva changed the title [runtime/network] poison sink/stream on error [runtime/network] poison sink/stream on error and cancellation Apr 3, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 94.42971% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.73%. Comparing base (54ee26b) to head (b9a1b69).

Files with missing lines Patch % Lines
runtime/src/mocks.rs 84.76% 15 Missing and 1 partial ⚠️
runtime/src/network/mod.rs 97.54% 4 Missing ⚠️
runtime/src/network/iouring.rs 98.38% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main    #3501      +/-   ##
==========================================
- Coverage   95.74%   95.73%   -0.01%     
==========================================
  Files         438      438              
  Lines      157975   158264     +289     
  Branches     3706     3722      +16     
==========================================
+ Hits       151249   151517     +268     
- Misses       5541     5562      +21     
  Partials     1185     1185              
Files with missing lines Coverage Δ
runtime/src/lib.rs 97.75% <ø> (+0.04%) ⬆️
runtime/src/network/deterministic.rs 96.29% <100.00%> (-0.85%) ⬇️
runtime/src/network/tokio.rs 89.73% <100.00%> (+0.80%) ⬆️
stream/src/utils/codec.rs 97.89% <100.00%> (+0.07%) ⬆️
runtime/src/network/iouring.rs 93.47% <98.38%> (+0.51%) ⬆️
runtime/src/network/mod.rs 98.60% <97.54%> (-0.65%) ⬇️
runtime/src/mocks.rs 94.92% <84.76%> (-4.31%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54ee26b...b9a1b69. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

[runtime/network] Allow read timeout recovery

2 participants