1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Fixed timeout condition in poll_enter_toi()

This commit is contained in:
Teemu Ollakka
2019-09-06 17:03:27 +03:00
parent 3a1b194741
commit 750052b640

View File

@ -339,6 +339,12 @@ wsrep::client_state::poll_enter_toi(
int flags,
std::chrono::time_point<wsrep::clock> wait_until)
{
WSREP_LOG_DEBUG(debug_log_level(),
wsrep::log::debug_level_client_state,
"poll_enter_toi: "
<< flags
<< ","
<< wait_until.time_since_epoch().count());
enum wsrep::provider::status status;
do
{
@ -366,8 +372,9 @@ wsrep::client_state::poll_enter_toi(
}
while (status == wsrep::provider::error_certification_failed &&
wait_until.time_since_epoch().count() &&
wait_until < wsrep::clock::now() &&
wsrep::clock::now() < wait_until &&
not client_service_.interrupted(lock));
/** @todo should report timeout error if wait times out */
return status;
}
@ -405,7 +412,7 @@ int wsrep::client_state::enter_toi_local(const wsrep::key_array& keys,
}
default:
override_error(wsrep::e_error_during_commit,
wsrep::provider::error_certification_failed);
status);
ret = 1;
break;
}
@ -723,6 +730,7 @@ void wsrep::client_state::debug_log_state(const char* context) const
<< "," << to_c_string(state_)
<< "," << to_c_string(mode_)
<< "," << wsrep::to_string(current_error_)
<< "," << current_error_status_
<< ",toi: " << toi_meta_.seqno()
<< ",nbo: " << nbo_meta_.seqno() << ")");
}