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

Empty reply from server when using a timeout > 10 seconds #3637

Closed
Myzel394 opened this issue Nov 6, 2024 · 4 comments
Closed

Empty reply from server when using a timeout > 10 seconds #3637

Myzel394 opened this issue Nov 6, 2024 · 4 comments
Labels

Comments

@Myzel394
Copy link

Myzel394 commented Nov 6, 2024

What version of Hono are you using?

4.6.9

What runtime/platform is your app running on? (with version if possible)

Bun (1.1.31)

What steps can reproduce the bug?

  1. Create a project using the Bun's template
  2. Add a timeout using hono.use("/", timeout(30_000))
  3. Do a request that takes longer than 10 seconds
  4. Timeout

What is the expected behavior?

Server should not timeout when using a timeout - or this should be settable.

What do you see instead?

Server logs:

[Bun.serve]: request timed out after 10 seconds. Pass `idleTimeout` to configure.

Client:

$ curl http://localhost:3000/
curl: (52) Empty reply from server

Additional information

A minimal proof of concept can be found here: https://github.com/Myzel394/hono-timeout-poc

@Myzel394 Myzel394 added the triage label Nov 6, 2024
@EdamAme-x
Copy link
Contributor

EdamAme-x commented Nov 6, 2024

Hi @Myzel394

Bun is a timeout in 10s by default.

So, you can try the follows code.

Bun.serve({
  ...app,
  // timeout in 60s
  idleTimeout: 60
})

@Myzel394
Copy link
Author

Myzel394 commented Nov 6, 2024

Where should I run Bun.serve? I'm using Hono

@EdamAme-x
Copy link
Contributor

EdamAme-x commented Nov 6, 2024

at here
export default app

@yusukebe yusukebe added not bug and removed triage labels Nov 7, 2024
@Myzel394
Copy link
Author

Myzel394 commented Nov 9, 2024

Can confirm this works - although I think this should automagically be handled by hono :D

@Myzel394 Myzel394 closed this as completed Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants