Skip to content

Remove obsolete Cache PUT serialization - #6984

Open
guybedford wants to merge 1 commit into
mainfrom
gbedford/fix-cache-put-clone-deadlock
Open

Remove obsolete Cache PUT serialization#6984
guybedford wants to merge 1 commit into
mainfrom
gbedford/fix-cache-put-clone-deadlock

Conversation

@guybedford

Copy link
Copy Markdown
Contributor

This removes obsolete Cache API PUT stream serialization, preventing a deadlock when concurrent cache.put() calls consume clones of the same unknown-length Response.

The serializer originally accounted for the aggregate runtime Cache PUT quota. That quota was removed in 2024, but the ordering remained. Since cloned response bodies apply tee backpressure, the first PUT can wait for the second branch while the second PUT waits for the first to release the serializer.

  • Allow unknown-length Cache PUT requests to start concurrently after output locks are released.
  • Remove the obsolete serializer stream wrapper and per-context state.
  • Add a regression test using two concurrent PUTs of cloned TransformStream response bodies.

Tested with all generated regression variants, ESLint, and the existing Cache API suite.

Unknown-length Cache API PUTs are serialized even though the runtime quota
that required ordering was removed. Concurrent puts of cloned response
bodies can deadlock when tee backpressure prevents the first body from
completing before the second starts.

Allow these requests to start concurrently and add a regression test.
@guybedford
guybedford requested review from a team as code owners August 12, 2026 18:46
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

2 similar comments
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@guybedford Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.46%. Comparing base (0c0f965) to head (f2a3708).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/workerd/api/cache.c++ 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6984      +/-   ##
==========================================
- Coverage   68.50%   68.46%   -0.04%     
==========================================
  Files         438      438              
  Lines      130173   130193      +20     
  Branches    21423    21417       -6     
==========================================
- Hits        89169    89132      -37     
- Misses      27964    28029      +65     
+ Partials    13040    13032       -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

5 similar comments
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants