Skip to content

Repro for shared WebSocket session failure in workerd#157

Open
edmundhung wants to merge 1 commit intocloudflare:mainfrom
edmundhung:websocket-issue
Open

Repro for shared WebSocket session failure in workerd#157
edmundhung wants to merge 1 commit intocloudflare:mainfrom
edmundhung:websocket-issue

Conversation

@edmundhung
Copy link
Member

@edmundhung edmundhung commented Mar 20, 2026

Related to #158

This adds 3 tests to reproduce the behavior under large payload volume:

# failing workerd case using one shared WebSocket session under large payload volume
pnpm test -- --project workerd __tests__/workerd.test.ts -t "fails with a shared websocket session"

# passing workerd control using fresh WebSocket sessions per batch
pnpm test -- --project workerd __tests__/workerd.test.ts -t "passes with a fresh websocket session per batch"

# passing Node control using the same shared WebSocket session pattern
pnpm test -- --project node __tests__/index.test.ts -t "same high-byte-volume workload in Node"

For the failing test, you should see something like this:

[vpw:info] Starting isolated runtimes for 1...

<--- Last few GCs --->

[16746:0xbf21f4000]     1353 ms: Mark-Compact 1399.4 (1423.0) -> 1399.4 (1423.0) MB, pooled: 2.2 MB, 2.02 / 0.00 ms (average mu = 0.113, current mu = 0.000) allocation failure; GC in old space requested
[16746:0xbf21f4000]     1355 ms: Mark-Compact 1399.4 (1423.0) -> 1399.4 (1423.0) MB, pooled: 2.2 MB, 2.02 / 0.00 ms (average mu = 0.060, current mu = 0.001) allocation failure; GC in old space requested

workerd/jsg/setup.c++:38: fatal: V8 fatal error; location = Ineffective mark-compacts near heap limit; message = : allocation failed: JavaScript heap out of memory
*** Received signal #6: Abort trap: 6
stack: 19b073887 19af7884f 1038d1f0f 103d0c18b 103ee937f 103ee765b 103efb6a3 103efb42b 103efaf47 103ed0cb7 103fe8cfb 103fef2ff 103fef3eb 103fef3eb 103fe86db 103fe8417 103d85a23 103bd960b 170286f8f 103b75983 103c50977 103b6601b 103b3addb 103e550cf 103e559ab 103e55aeb 103e6b10f 103e6af7b 1038aa7cf

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: fetch failed
 ❯ node_modules/.pnpm/undici@7.18.2/node_modules/undici/index.js:127:13
 ❯ process.processTicksAndRejections node:internal/process/task_queues:105:5
 ❯ MessagePort.<anonymous> [worker eval]:28:22

Caused by: Error: connect ECONNREFUSED 127.0.0.1:55534
 ❯ TCPConnectWrap.afterConnect [as oncomplete] node:net:1637:16

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

⚠️ No Changeset found

Latest commit: de50c08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/capnweb@157

commit: de50c08

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.

1 participant