eBay / NuRaft

C++ implementation of Raft core logic as a replication library
Apache License 2.0
997 stars 236 forks source link

Fix Deadlock between snapshot_sync_req and background snapshot creation. #426

Closed szmyd closed 1 year ago

szmyd commented 1 year ago

The RPC service can deadlock the background thread during snapshot creation and synchronization. Both race to take the lock_ mutex, but the RPC service will hold it while waiting for the snapshot to complete (which it never will). The loop that checks for snapshot progress needs to give up this lock.