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

riak_cs_access_archiver_manager always fails to throttle access archiver #758

Merged
merged 3 commits into from
Dec 28, 2013

Conversation

kuenishi
Copy link
Contributor

even when the number of active workers exceeded max_workers, because the handle_call({archive, _, _}, ...) never matches to the message called from riak_cs_access_archiver_manager:archive/2.

Not sure what to test here, or how to reproduce, probably I can write riak_test by setting access_archiver_max_workers as 0. I'd be happy
write the test if it's not trivial.

number of active workers exceeded max_workers, because the
handle_call({archive, _, _}, ...) never matches to the message
called from riak_cs_access_archiver_manager:archive/2.
@andrewjstone
Copy link
Contributor

Code looks correct to me.

That module never gets called with that clause.

Andrews-MacBook-Pro:riak_cs ajs$ grep '{archive' src/*
src/riak_cs_access_log_handler.erl:handle_info({archive, Ref}, #state{archive=Ref}=State) ->
src/riak_cs_access_log_handler.erl:            erlang:send_after(TL*1000, self(), {archive, Ref}),
src/riak_cs_access_log_handler.erl:            {ok, State#state{archive=Ref}};

@andrewjstone
Copy link
Contributor

  • manual test throttling
  • eunit + eqc tests
  • dialyzer
  • xref

@andrewjstone
Copy link
Contributor

I tested this by setting

 {access_archiver_max_backlog, 1},
 {access_archiver_max_workers, 1}

I then ran riak-cs-access flush

This change triggers the crash below, so I'm 👎 on this until that is resolved.

2013-12-26 15:01:04 =ERROR REPORT====
** State machine <0.380.0> terminating
** Last message in was {'ETS-TRANSFER',32795,<0.95.0>,{{{2013,12,26},{20,0,47}},{{2013,12,26},{20,1,4}}}}
** When State == idle
**      Data  == {state,<0.381.0>,#Ref<0.0.0.1360>,undefined,undefined,undefined}
** Reason for termination =
** {badarg,[{gen_fsm,send_event,2,[{file,"gen_fsm.erl"},{line,198}]},{riak_cs_access_archiver,continue,1,[{file,"src/riak_cs_access_archiver.erl"},{line,223}]},{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,494}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
2013-12-26 15:01:04 =CRASH REPORT====
  crasher:
    initial call: riak_cs_access_archiver:init/1
    pid: <0.380.0>
    registered_name: []
    exception exit: {{badarg,[{gen_fsm,send_event,2,[{file,"gen_fsm.erl"},{line,198}]},{riak_cs_access_archiver,continue,1,[{file,"src/riak_cs_access_archiver.erl"},{line,223}]},{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,494}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]},[{gen_fsm,terminate,7,[{file,"gen_fsm.erl"},{line,611}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
    ancestors: [riak_cs_access_archiver_manager,riak_cs_sup,<0.144.0>]
    messages: [{'$gen_sync_all_state_event',{<0.378.0>,#Ref<0.0.0.1365>},status}]
    links: [<0.287.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 24
    reductions: 227
  neighbours:

@kuenishi
Copy link
Contributor Author

Geez. I'll work on it today.

@kuenishi
Copy link
Contributor Author

This is due to #747 : so I cherry-picket b0f8977 and manual testing worked.

shino and others added 2 commits December 27, 2013 12:58
Original issue: #746

To complete multiple archiver processes support introduced at:
  #717 Only a single access archiver can run at a time
  #717
registered name references should be removed.
@ghost ghost assigned kuenishi Dec 27, 2013
@andrewjstone
Copy link
Contributor

👍

kuenishi added a commit that referenced this pull request Dec 28, 2013
riak_cs_access_archiver_manager always fails to throttle access archiver
@kuenishi kuenishi merged commit a06554e into release/1.4 Dec 28, 2013
@kuenishi kuenishi deleted the bugfix/access-archiver-throttle branch December 28, 2013 11:49
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