Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the 'dataMap' field a ConcurrentHashMap instead of a HashMap, to prevent a ConcurrentModificationException, which was recently observed when calling 'IgnoredMailboxMap::toProtoMessage' from the persistence manager inside the user thread during startup of bisq-desktop. Tracing through the code, this likely happened during an iteration through the keyset of 'dataMap' (to check for nulls, inside the proto serialisation logic during persistence), while simultaneously adding ignored mailbox messages to the map on a separate thread spawned from the method, 'MailboxMessageService::threadedBatchProcessMailboxEntries'. (The latter was made asynchronous so as not to block the UI.) (Since there is a call to 'PersistenceManager::requestPersistence' after every addition to the ignored mailbox map, there hopefully won't be any missed entries in the final persisted map, even though the snapshot of ConcurrentHashMap being iterated through won't be fresh as long as new entries are simultaneously added.)
- Loading branch information