Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changes to make PULSE test more stable

  • Loading branch information...
commit d950b9578cf6f3b2ad5fd03be2d581c7df6bbd30 1 parent a6cc3ae
@jtuple jtuple authored
View
2  c_src/bitcask_nifs.c
@@ -1646,7 +1646,7 @@ static void msg_pending_awaken(ErlNifEnv* env, bitcask_keydir* keydir,
for (idx = 0; idx < keydir->pending_awaken_count; idx++)
{
enif_clear_env(msg_env);
-#ifdef PULSE
+#ifdef PULSE_NOWAY_JOSE
PULSE_SEND(env, &keydir->pending_awaken[idx], msg_env, msg);
#else
enif_send(env, &keydir->pending_awaken[idx], msg_env, msg);
View
28 src/bitcask_nifs.erl
@@ -245,11 +245,11 @@ keydir_fold(Ref, Fun, Acc0, MaxAge, MaxPuts) ->
keydir_frozen(Ref, FrozenFun, MaxAge, MaxPuts) ->
case keydir_itr(Ref, MaxAge, MaxPuts) of
out_of_date ->
- receive
- ready -> % fold no matter what on second attempt
+ case keydir_wait_ready() of
+ ok ->
keydir_frozen(Ref, FrozenFun, -1, -1);
- error ->
- {error, shutdown}
+ Else ->
+ Else
end;
ok ->
try
@@ -278,6 +278,26 @@ keydir_wait_pending(Ref) ->
ok
end.
+-ifdef(PULSE).
+keydir_wait_ready() ->
+ receive
+ ready -> % fold no matter what on second attempt
+ ok;
+ error ->
+ {error, shutdown}
+ after 1000 ->
+ keydir_wait_ready()
+ end.
+-else.
+keydir_wait_ready() ->
+ receive
+ ready -> % fold no matter what on second attempt
+ ok;
+ error ->
+ {error, shutdown}
+ end.
+-endif.
+
keydir_info(_Ref) ->
erlang:nif_error({error, not_loaded}).
View
2  test/pulse/bitcask_eqc.erl
@@ -272,7 +272,7 @@ mute(false, Fun) -> mute:run(Fun).
run_commands_on_node(LocalOrSlave, Cmds, Seed, Verbose) ->
mute(Verbose, fun() ->
AfterTime = if LocalOrSlave == local -> 50000;
- LocalOrSlave == remote -> 1000000
+ LocalOrSlave == slave -> 1000000
end,
event_logger:start_link(),
pulse:start(),
Please sign in to comment.
Something went wrong with that request. Please try again.