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

🐛 Long lived websocket seems to disconnect consistently #1282

Open
AquiGorka opened this issue Jul 1, 2024 · 5 comments
Open

🐛 Long lived websocket seems to disconnect consistently #1282

AquiGorka opened this issue Jul 1, 2024 · 5 comments
Labels
Priority: Normal Minor issue impacting one or more users Type: Bug Something isn't working

Comments

@AquiGorka
Copy link

Describe the bug and To Reproduce
A service is being exposed via a cloudflared tunnel (http endpoint).
Clients connect to the service via the exposed tunnel which then upgrades the connection to a websocket.
The clients consistently disconnect - and a successful reconnect happens since our clients can reconnect.

Expected behavior
This only happens when the client connects via the tunnel, if no tunnel is being used the disconnect behavior does not happen.

Environment and versions

  • OS: Service: Linux and Macos
  • Architecture: arm64
  • Version: cloudflared version 2024.6.0 (built 2024-06-03T18:29:11Z)

Logs and errors
When the socket disconnects we do get this output: Read error: websocket: close 1006 (abnormal closure): unexpected EOF

@AquiGorka AquiGorka added Priority: Normal Minor issue impacting one or more users Type: Bug Something isn't working labels Jul 1, 2024
@AquiGorka AquiGorka changed the title 🐛 Long lived websocket seems to disconnect and reconnect consistently 🐛 Long lived websocket seems to disconnect consistently Jul 1, 2024
@flpydsk
Copy link

flpydsk commented Jul 29, 2024

This is actually not a bug, rather a limitation of the current production websocket impl, you can contact support and ask them to enable the Websocket handoff feature which can increase the lifetime of a websocket connection by an order of magnitude. the drawback of this is lesser visibility (you are unable to view total bandwidth of websockets in the zone)

@jgvmonteiro
Copy link

jgvmonteiro commented Aug 1, 2024

"When Cloudflare releases new code to its global network, we may restart servers, which terminates WebSockets connections."

Is this the reason? Any plans this will change? (soon ?)

Unless its something on my end sometimes its reconnecting every other minute which kinda makes it hard to make it unnoticed

@flpydsk
Copy link

flpydsk commented Aug 1, 2024

I don't work at cf and can't comment about any plans that may or may not exist but you can ask support to enable websocket handover

@flpydsk
Copy link

flpydsk commented Aug 1, 2024

"When Cloudflare releases new code to its global network, we may restart servers, which terminates WebSockets connections."

Is this the reason? Any plans this will change? (soon ?)

Unless its something on my end sometimes its reconnecting every other minute which kinda makes it hard to make it unnoticed

every other minute is quite often, Id think there is something else going on, possibly config somewhere. consider asking support or posting in discord/forums

@jgvmonteiro
Copy link

jgvmonteiro commented Aug 1, 2024

Its mostly fine but yes some days theres very "hot" 10 minutes of reconnects. Also find it hard to believe this is expected but only does it through the tunnel and at specific times of the day so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Normal Minor issue impacting one or more users Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants