Skip to content
This repository
Browse code

Add ability to selectively disable incoming/outgoing handoff

  • Loading branch information...
commit 3504ad11c84e7552fdf5f3c21fb9c8b478705ea2 1 parent fe960d3
Joseph Blomstedt authored December 19, 2012

Showing 1 changed file with 12 additions and 2 deletions. Show diff stats Hide diff stats

  1. 14  src/riak_core_handoff_manager.erl
14  src/riak_core_handoff_manager.erl
@@ -74,10 +74,20 @@ init([]) ->
74 74
     {ok, #state{excl=ordsets:new(), handoffs=[]}}.
75 75
 
76 76
 add_outbound(Module,Idx,Node,VnodePid) ->
77  
-    gen_server:call(?MODULE,{add_outbound,Module,Idx,Node,VnodePid},infinity).
  77
+    case application:get_env(riak_core, disable_outbound_handoff) of
  78
+        {ok, true} ->
  79
+            {error, max_concurrency};
  80
+        _ ->
  81
+            gen_server:call(?MODULE,{add_outbound,Module,Idx,Node,VnodePid},infinity)
  82
+    end.
78 83
 
79 84
 add_inbound(SSLOpts) ->
80  
-    gen_server:call(?MODULE,{add_inbound,SSLOpts},infinity).
  85
+    case application:get_env(riak_core, disable_inbound_handoff) of
  86
+        {ok, true} ->
  87
+            {error, max_concurrency};
  88
+        _ ->
  89
+            gen_server:call(?MODULE,{add_inbound,SSLOpts},infinity)
  90
+    end.
81 91
 
82 92
 %% @doc Initiate a transfer from `SrcPartition' to `TargetPartition'
83 93
 %%      for the given `Module' using the `FilterModFun' filter.

0 notes on commit 3504ad1

Please sign in to comment.
Something went wrong with that request. Please try again.