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

Validate that queue_group is specified as a valid iolist entry #58

Open
mmmries opened this issue Jul 2, 2017 · 0 comments
Open

Validate that queue_group is specified as a valid iolist entry #58

mmmries opened this issue Jul 2, 2017 · 0 comments

Comments

@mmmries
Copy link
Collaborator

mmmries commented Jul 2, 2017

I was recently working on implementing an RPC server which would setup long-lived subscriptions and I was getting an error that kept crashing the Gnat connection process.

 [error] connection failed {{:badmatch, {:error, :einval}}, [{Gnat, :handle_call, 3, [file: 'lib/gnat.ex', line: 195]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 615]}, {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 647]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}

After a bunch of digging I found out that it was because I was calling Gnat.sub with queue_group: :dispatch_ex. The TCP library wouldn't serialize that atom in an iolist, it needed to be specified as a string or a charlist. This was pretty confusing to track down, and having a nice error message would have been very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant