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

codership/wsrep-lib#34 Provided a method to interrupt state waiters

Intruduced server_state::interrupt_state_waiters() to interrupt
all waiters inside server_state::wait_until_state(). This mechanism
is needed when an error is encountered during state change processing
and waiting threads may need to be interrupted to check and handle
the error condition.

Made server_state::wait_until_state() to throw exception if the
wait was interrupted and the new server state is either disconnecting
or disconnected, which usually indicates error condition.
This commit is contained in:
Teemu Ollakka
2018-12-20 13:42:21 +02:00
parent ac5a4cde0d
commit e9bb552096
3 changed files with 22 additions and 4 deletions

View File

@ -364,7 +364,7 @@ namespace
}
catch (const wsrep::runtime_error& e)
{
std::cerr << "Exception: " << e.what();
wsrep::log_error() << "Exception: " << e.what();
return WSREP_CB_FAILURE;
}
}
@ -389,7 +389,7 @@ namespace
}
catch (const wsrep::runtime_error& e)
{
std::cerr << "Exception: " << e.what();
wsrep::log_error() << "Exception: " << e.what();
return WSREP_CB_FAILURE;
}
}