I recently updated phoenix to latest version 14.16.
While I start the application a socket is trying to reconnect to server. Since somehow the application is not yet fully started I get a lot of crashes like this:
[error] #PID<0.1221.0> running Carts.ApiWeb.Endpoint (connection #PID<0.1220.0>, stream id 1) terminated
Server: carts-api.zuppler.test:80 (http)
Request: GET /carts/socket/websocket?vsn=2.0.0
** (exit) an exception was raised:
** (ArgumentError) argument error
(stdlib 3.12) :ets.lookup(Carts.ApiWeb.Endpoint, :code_reloader)
lib/phoenix/endpoint.ex:542: Carts.ApiWeb.Endpoint.config/2
(phoenix 1.4.16) lib/phoenix/socket/transport.ex:324: Phoenix.Socket.Transport.code_reload/3
(phoenix 1.4.16) lib/phoenix/transports/websocket.ex:18: Phoenix.Transports.WebSocket.connect/4
(phoenix 1.4.16) lib/phoenix/endpoint/cowboy2_handler.ex:21: Phoenix.Endpoint.Cowboy2Handler.init/4
(cowboy 2.7.0) /Users/silviu/development/zuppler/carts-api/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
(cowboy 2.7.0) /Users/silviu/development/zuppler/carts-api/deps/cowboy/src/cowboy_stream_h.erl:320: :cowboy_stream_h.execute/3
(cowboy 2.7.0) /Users/silviu/development/zuppler/carts-api/deps/cowboy/src/cowboy_stream_h.erl:302: :cowboy_stream_h.request_process/3
(stdlib 3.12) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Since it happens continually the CPU goes to 100% and the errors keep flowing into out bugtracker.
I have not idea how to fix it. Any hits?
My guess is that somehow the phoenix app starts before :ets is initialized. Is this possible?