mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-03 16:22:35 +03:00
Allow concurrent server_state disconnect operations.
Shutting down the provider may cause replication/appling failures, which may further result to disconnect calls from failing operations. Allow concurrent disconnect requests to deal with such a situations.
This commit is contained in:
@ -524,6 +524,15 @@ int wsrep::server_state::disconnect()
|
||||
{
|
||||
{
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
// In case of failure situations which are caused by provider
|
||||
// being shut down some failing operation may also try to shut
|
||||
// down the replication. Check the state here and
|
||||
// return success if the provider disconnect is already in progress
|
||||
// or has completed.
|
||||
if (state(lock) == s_disconnecting || state(lock) == s_disconnected)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
state(lock, s_disconnecting);
|
||||
interrupt_state_waiters(lock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user