bun icon indicating copy to clipboard operation
bun copied to clipboard

Concurrent fetch leads to ConnectionClosed fetch failed

Open jmmoser opened this issue 1 year ago • 1 comments

What version of Bun is running?

0.4.0

What platform is your computer?

Darwin 22.1.0 arm64 arm

What steps can reproduce the bug?

// client.js
await Promise.all([...Array(200)].map(() => fetch('http://localhost:3000')));

// server.js
export default {
  port: 3000,
  fetch() {
    return new Response("");
  },
};
# keep this running
bun run server.js
bun run client.js

What is the expected behavior?

No failures. node client.js works.

What do you see instead?

❯ bun run client.js 
ConnectionClosed: fetch() failed
 path: "http://localhost:3000"

Additional information

No response

jmmoser avatar Jan 05 '23 04:01 jmmoser

This seems to happen after 174 simultaneous requests. It's not related to the server. Just the HTTP client.

Jarred-Sumner avatar Jan 05 '23 05:01 Jarred-Sumner

This issue appears to be resolved in version 0.5.0. Closing.

jmmoser avatar Jan 18 '23 21:01 jmmoser