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

fix(ext/websocket): change default idleTimeout to 30s #23985

Merged
merged 2 commits into from
May 26, 2024

Conversation

alexgleason
Copy link
Contributor

Nginx has a default timeout of 60 seconds. I fell down this rabbit hole trying to figure out why WebSockets kept getting closed every 60 seconds in my application. First I found #15430 and assumed ping/pong doesn't work in Deno at all. Then I found #13172 and the discussion in #13168.

It turns out, there is already an automatic ping/pong in Deno. But it only happens every 120 seconds by default.

So I set the idleTimeout to 30s in my application, and suddenly my problems went away.

It seems to me that the default should be 30s. Otherwise people will continue to have this problem. With 30s it "just works" with common setups.

@ry
Copy link
Member

ry commented May 25, 2024

Seems reasonable to me…

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with a comment

ext/http/02_websocket.ts Show resolved Hide resolved
@littledivy littledivy merged commit f8975a8 into denoland:main May 26, 2024
17 checks passed
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.

3 participants