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

try/catch for rex error #181

Merged
merged 1 commit into from
May 9, 2014
Merged

try/catch for rex error #181

merged 1 commit into from
May 9, 2014

Conversation

joedevivo
Copy link
Contributor

If rex is down on a running node, rpc:calls to that node will crash the riak_control appliction. Wrapping them in a try/catch will prevent that.

@cmeiklejohn cmeiklejohn added this to the 2.0-RC milestone May 8, 2014
@cmeiklejohn
Copy link
Contributor

Can we rebase this up into a single commit?

@reiddraper
Copy link

This is not seeming to fix the error for me. I created a clean, five node cluster with make stagedevrel, after checking out this riak_control branch in deps/. I run riak_control on the first node (dev1). riak_control loads fine. Then, I attach to dev2: ./dev/dev2/bin/riak attach, and run unregister(rex).. I then see the first node crash.

➜  riak-2.0 git:(develop) tail -n 30 dev/dev1/log/console.log | head -n 10
2014-05-08 15:42:53.774 [error] <0.7107.0> CRASH REPORT Process <0.7107.0> with 0 neighbours exited with reason: call to undefined function lager:warning("rpc:call(~p, riak_control_session, get_my_info, []) failed with reason: ~p", ['dev2@127.0.0.1',{noproc,{gen_server,call,[{rex,'dev2@127.0.0.1'},{call,riak_control_session,get_my_info,...},...]}}]) in gen_server:init_it/6 line 328
2014-05-08 15:42:53.774 [error] <0.535.0> Supervisor riak_control_sup had child riak_control_session started with riak_control_session:start_link() at {restarting,<0.537.0>} exit with reason call to undefined function lager:warning("rpc:call(~p, riak_control_session, get_my_info, []) failed with reason: ~p", ['dev2@127.0.0.1',{noproc,{gen_server,call,[{rex,'dev2@127.0.0.1'},{call,riak_control_session,get_my_info,...},...]}}]) in context start_error
2014-05-08 15:42:53.791 [error] <0.7111.0> CRASH REPORT Process <0.7111.0> with 0 neighbours exited with reason: call to undefined function lager:warning("rpc:call(~p, riak_control_session, get_my_info, []) failed with reason: ~p", ['dev2@127.0.0.1',{noproc,{gen_server,call,[{rex,'dev2@127.0.0.1'},{call,riak_control_session,get_my_info,...},...]}}]) in gen_server:init_it/6 line 328
2014-05-08 15:42:53.792 [error] <0.535.0> Supervisor riak_control_sup had child riak_control_session started with riak_control_session:start_link() at {restarting,<0.537.0>} exit with reason call to undefined function lager:warning("rpc:call(~p, riak_control_session, get_my_info, []) failed with reason: ~p", ['dev2@127.0.0.1',{noproc,{gen_server,call,[{rex,'dev2@127.0.0.1'},{call,riak_control_session,get_my_info,...},...]}}]) in context start_error
2014-05-08 15:42:53.792 [error] <0.535.0> Supervisor riak_control_sup had child riak_control_session started with riak_control_session:start_link() at {restarting,<0.537.0>} exit with reason reached_max_restart_intensity in context shutdown
2014-05-08 15:42:53.793 [info] <0.7.0> Application riak_control exited with reason: shutdown
2014-05-08 15:42:53.799 [info] <0.315.0>@riak_kv_app:prep_stop:218 Stopping application riak_kv - marked service down.
2014-05-08 15:42:53.799 [info] <0.315.0>@riak_kv_app:prep_stop:222 Unregistered pb services
2014-05-08 15:42:53.800 [info] <0.315.0>@riak_kv_app:prep_stop:227 unregistered webmachine routes
2014-05-08 15:42:53.800 [info] <0.315.0>@riak_kv_app:prep_stop:229 all active put FSMs completed

@reiddraper
Copy link

It's certainly possible this is some environment issue, I'll keep playing around with different incantations of 'clean devclean', etc.

@reiddraper
Copy link

I've tried re-cleaning, and verifying that I'm using the correct riak_control code:

➜  riak-2.0 git:(develop) ls -lah dev/dev1/lib/riak_control
lrwxr-xr-x  1 reid  staff    70B May  8 15:53 dev/dev1/lib/riak_control -> /Users/reid/Documents/repos/basho-versioned/riak-2.0/deps/riak_control
➜  riak-2.0 git:(develop) cd deps/riak_control
➜  riak_control git:(bugfix/jnd/rex) git branch
* bugfix/jnd/rex
  develop

@joedevivo
Copy link
Contributor Author

This actually looks like a lager problem. Will investigate.

@joedevivo
Copy link
Contributor Author

lager:warning(
    "rpc:call(~p, riak_control_session, get_my_info, []) failed with reason: ~p", 
    ['dev2@127.0.0.1',
      {noproc,{gen_server,call,[{rex,'dev2@127.0.0.1'},{call,riak_control_session,get_my_info,...},...]}}])

this call should work. anybody see something I don't?

@joedevivo
Copy link
Contributor Author

riak_control doesn't have the lager parse transform. adding now.

try/catch for rex error

Wrapped other rpc:calls with try/catch

Added lager warning messages to rex try/catches

Added lager parse transform to rebar.config
@reiddraper
Copy link

Nice work @joedevivo. +1 on fa6c55e.

joedevivo added a commit that referenced this pull request May 9, 2014
@joedevivo joedevivo merged commit 3fe302e into develop May 9, 2014
@joedevivo joedevivo deleted the bugfix/jnd/rex branch May 9, 2014 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants