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

/stats endpoint broken #50

Open
Synse opened this issue Sep 10, 2020 · 1 comment
Open

/stats endpoint broken #50

Synse opened this issue Sep 10, 2020 · 1 comment

Comments

@Synse
Copy link
Contributor

Synse commented Sep 10, 2020

The /stats endpoint is currently returning an HTTP 500 error. The following error is logged to the console when this happens:

19:10:46.014 [error] Ranch listener :websocket_server, connection process #PID<0.5364.0>, stream 4 had its request process #PID<0.5399.0> exit with reason :function_clause and stacktrace [{Access, :get, [:ok, :url, nil], []}, {Certstream.WebsocketServer, :"-init/2-fun-0-", 2, [file: 'lib/web.ex', line: 39]}, {Enum, :"-reduce/3-lists^foldl/2-0-", 3, [file: 'lib/enum.ex', line: 2111]}, {Certstream.WebsocketServer, :init, 2, [file: 'lib/web.ex', line: 37]}, {:cowboy_handler, :execute, 2, [file: '/home/codespace/workspace/certstream-server/deps/cowboy/src/cowboy_handler.erl', line: 37]}, {:cowboy_stream_h, :execute, 3, [file: '/home/codespace/workspace/certstream-server/deps/cowboy/src/cowboy_stream_h.erl', line: 300]}, {:cowboy_stream_h, :request_process, 3, [file: '/home/codespace/workspace/certstream-server/deps/cowboy/src/cowboy_stream_h.erl', line: 291]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]

After looking at the code for a bit I believe there are two issues here.

  • :sys.get_state can timeout
  • state is :ok for any workers that failed to start completely
@Fitblip
Copy link
Member

Fitblip commented Nov 30, 2020

Hey @Synse, yeah I had no idea that :sys.get_state could timeout, but under load it definitely does which causes issues. I'm going to be cleaning some stuff up so I'll try to get to this as well!

Thanks for the bug report!

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

No branches or pull requests

2 participants