Skip to content

[FIXED in 4.6.0] Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume #152

Closed

Description

@okomarov

On Cloudflare Workers, the cloudflare:sockets polyfill (cf/polyfills.js) has no pause() or resume(). src/connection.js calls socket.resume() on the first read of a COPY TO stream and socket.pause() under backpressure, so:

Reproduced in real workerd (Wrangler 4.151.1) at compatibility dates 2025-01-01, 2025-09-15 and 2026-10-12 by the copy-out and subscribe scenarios in tests-startup/workerd-worker.js: run 39149730488 (PR #150). On src/ running over workerd's own node:net, both pass.

Fix on PR #151: the polyfill socket gets pause()/resume(), and its read loop waits after a chunk while paused.

Activity

  1. added
    bug
    area: runtimes
    upstream
    on Oct 18, 2026
  2. moved this to In progress in Roadmapon Oct 18, 2026
  3. okomarov commented on Oct 19, 2026

    @okomarov
    Author

    Fixed on main by 2cf42d9 (#151); ships in the next release.

  4. added this to the 4.6.0 milestone on Oct 20, 2026
  5. okomarov commented on Oct 20, 2026

    @okomarov
    Author

    Rechecked on 3.4.9 in workerd from Wrangler 4.151.1, with only 3.4.9's timer calls patched (porsager#1088): copy-out fails with porsager#975's socket.resume is not a function at 2025-01-01, 2025-09-15 and 2026-10-12, and subscribe never delivers (the server rejects invalid standby message type "f"). The fork passes both at every date (run https://github.com/steadybrew/postgresjs/actions/runs/39453433731). Ships in the next release; the title gets its version then.

  6. moved this from In progress to Shipped in Roadmapon Oct 21, 2026
  7. changed the title [-]Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume[/-] [+][FIXED in 4.6.0] Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume[/+] on Oct 21, 2026
  8. okomarov commented on Oct 21, 2026

    @okomarov
    Author

    Shipped in 4.6.0 (npm install @steadybrew/[email protected]), unchanged from 4.6.0-rc1. The tests that cover it passed in the tag run.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: runtimesbugupstream

    Type

    No type

    Projects

    • Status
      Shipped

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions