1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +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

@ -600,6 +600,8 @@ namespace wsrep
void resync(wsrep::unique_lock<wsrep::mutex>&);
void state(wsrep::unique_lock<wsrep::mutex>&, enum state);
void wait_until_state(wsrep::unique_lock<wsrep::mutex>&, enum state) const;
// Interrupt all threads which are waiting for state
void interrupt_state_waiters(wsrep::unique_lock<wsrep::mutex>&);
// Close SR transcations whose origin is outside of current
// cluster view.
void close_orphaned_sr_transactions(