Anonymous avatar Anonymous committed 6b8308b

check Mod:put return during handoff

Comments (0)

Files changed (1)


 active(timeout, StateData) ->
 active({diffobj,{BKey,BinObj,FromVN}}, StateData) ->
-    do_diffobj_put(BKey, binary_to_term(BinObj), StateData),
-    gen_fsm:send_event(FromVN,{resolved_diffobj,BKey}),
+    case do_diffobj_put(BKey, binary_to_term(BinObj), StateData) of
+        ok ->
+            gen_fsm:send_event(FromVN,{resolved_diffobj,BKey});
+        {error, Err} ->
+            error_logger:error_msg("Error storing handoff obj: ~p~n", [Err])
+    end,
 active({map, ClientPid, QTerm, BKey, KeyData},
        StateData=#state{mapcache=Cache,mod=Mod,modstate=ModState}) ->
         {newobj, NewObj} ->
             AMObj = enforce_allow_mult(NewObj, riak_bucket:get_bucket(Bucket)),
             Val = term_to_binary(AMObj),
-            Mod:put(ModState, BKey, Val),
-            riak_stat:update(vnode_put);
-        _ -> nop
+            Res = Mod:put(ModState, BKey, Val),
+            case Res of
+                ok -> riak_stat:update(vnode_put);
+                _ -> nop
+            end,
+            Res;
+        _ -> ok
 %% @private
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.