Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BurningManAccountingStore data races #6551

Conversation

alvasw
Copy link
Contributor

@alvasw alvasw commented Feb 1, 2023

Multiple threads read and write to the accounting blocks list causing data races. Luckily, the LinkedList threw a ConcurrentModificationException to limit damage. Now, a ReadWriteLock protects the LinkedList against data races. Multiple threads can read the list at the same time but only one thread can write to it. Other writing threads wait until it's their turn.

Fixes #6545

@alvasw alvasw force-pushed the fix_burningman_accounting_store_data_races branch from dfad3bb to cc95f53 Compare February 2, 2023 12:03
@alvasw alvasw marked this pull request as draft February 3, 2023 13:15
@alvasw alvasw changed the title Fix BurningManAccountingStore data races [WIP - Do not merge] - Fix BurningManAccountingStore data races Feb 3, 2023
@alvasw alvasw force-pushed the fix_burningman_accounting_store_data_races branch from cc95f53 to 04343bf Compare February 3, 2023 13:24
@alvasw alvasw changed the title [WIP - Do not merge] - Fix BurningManAccountingStore data races Fix BurningManAccountingStore data races Feb 3, 2023
@alvasw alvasw marked this pull request as ready for review February 3, 2023 13:25
@alvasw alvasw force-pushed the fix_burningman_accounting_store_data_races branch from 04343bf to 608e42d Compare February 3, 2023 22:12
Multiple threads read and write to the accounting blocks list causing
data races. Luckily, the LinkedList threw a ConcurrentModificationException
to limit damage. Now, a ReadWriteLock protects the LinkedList against
data races. Multiple threads can read the list at the same time but only
one thread can write to it. Other writing threads wait until it's their
turn.

Fixes bisq-network#6545
@alvasw alvasw force-pushed the fix_burningman_accounting_store_data_races branch from 608e42d to 4779c82 Compare February 3, 2023 22:43
@alvasw alvasw marked this pull request as draft February 3, 2023 22:46
@alvasw alvasw changed the title Fix BurningManAccountingStore data races [WIP] Fix BurningManAccountingStore data races Feb 3, 2023
@alvasw alvasw changed the title [WIP] Fix BurningManAccountingStore data races Fix BurningManAccountingStore data races Feb 4, 2023
@alvasw alvasw marked this pull request as ready for review February 4, 2023 12:40
Copy link
Contributor

@alejandrogarcia83 alejandrogarcia83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConcurrentModificationException on receiving NewAccountingBlockBroadcastMessage
2 participants