Unverified Commit 39f24a05 authored by Shaya Potter's avatar Shaya Potter Committed by GitHub
Browse files

Enforce return values from applylog callback (#76)

the only valid return values are 0 (success) or RAFT_ERR_SHUTDOWN.

this is now enforced by an assert
parent e8096ed1
......@@ -1256,6 +1256,7 @@ int raft_apply_entry(raft_server_t* me_)
if (me->cb.applylog)
{
int e = me->cb.applylog(me_, me->udata, ety, me->last_applied_idx);
assert(e == 0 || e == RAFT_ERR_SHUTDOWN);
if (RAFT_ERR_SHUTDOWN == e) {
raft_entry_release(ety);
return RAFT_ERR_SHUTDOWN;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment