alisyd
Liveview Crashes after some time
Hello there, we have an app built with phoenix liveview which shows tick by tick market data for selected stocks every second, the app works fine on local network, but the websocket connection keeps disconnecting with 1006 when using a public IP or a reverse proxy. We have been trying to debug this for a while, any help is appreciated. Phoenix doesn’t reconnect when the websocket disconnect occurs, instead the entire page is reloaded again, even if we have turn off the code reloader
First Post!
Hermanverschooten
Hi @alisyd
To answer the second part of your question first, live views are processes managed by a supervisor.
The supervisor restarts the process if it crashes, this is by design in OTP and is totally distant from the code reloading that happens in development.
If you say it keeps disconnecting, does this mean it does connect or never connects?
What is your setup? Are you connecting directly to the Phoenix app or is there a reverse-proxy or load-balancer or … in between?
What is in the log of the Phoenix app?
Last Post!
alisyd
thanks for the responding, turns out it was because of delayed replies to heartbeat message from js client, so heartbeat timeout occurs and liveView reconnects agains. And also this does not occur when connected to local network and the issue is more prominent when phoenix app is put behind a reverse proxy, and yes this is with a dev build, we have disabled code reloader. I am assuming this has something to do with the udp listener, I have in the application which listens for data from a different application. when I turn off the udp listener everything works fine, and also I am updating socket assigns, every second. udp listener is a genserver that listens for data over a port, I have put a large value for recbuf (65536), Idk if that is causing the issue.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









