concord-bft
concord-bft copied to clipboard
Fix data race on ClientsInfo's requestsInfo and repliesInfo maps.
We need to sync access to those maps, because they get modified/queried by multiple threads. We introduce 2 mutexes that guard each and make sure we never hold them both at the same time for a given ClientInfo object.repliesInfo.
We need to sync access to those maps, because they get modified/queried by multiple threads. We introduce 2 mutexes that guard each and make sure we never hold them both at the same time for a given ClientInfo object.repliesInfo
Thanks for spotting that!
Out of curiosity, which threads are accessing the clients manager concurrently? I had the same need and, if you remember, we introduced an internal message to only access it from the messaging thread. Can we use the same approach here as well, to avoid locks and reduce complexity?