Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server connection closing with empty response if code takes a long time for execution #909

Open
susemeee opened this issue Nov 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@susemeee
Copy link

susemeee commented Nov 4, 2024

What version of Elysia is running?

1.1.24

What platform is your computer?

Darwin 24.0.0 arm64 arm

What steps can reproduce the bug?

import { sleep } from "bun";
import Elysia from "elysia";

const app = new Elysia();

app.get("/", async () => {
  await sleep(20000);
  return "Hello World";
});

app.listen(3000);

console.log(
  `🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`
);
http get http://localhost:3000

or

curl http://localhost:3000

What is the expected behavior?

'Hello world' after 20 seconds

What do you see instead?

http: error: ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) while doing a GET request to URL: http://localhost:3000/
curl: (52) Empty reply from server

Additional information

Bun v1.1.30

Using express in the same environment (with the code below) works as expected

import { sleep } from "bun";

const express = require("express");
const app = express();

app.get("/", async (req, res) => {
  await sleep(20000);
  res.send("Hello World");
});

app.listen(3000);

console.log(`🦊 Express is running at http://localhost:3000`);

Have you try removing the node_modules and bun.lockb and try again yet?

yes

@susemeee susemeee added the bug Something isn't working label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant