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 remaining data race in BurningManAccountingStore #7047

Commits on Feb 24, 2024

  1. Fix remaining data race in BurningManAccountingStore

    Add missing synchronisation to the 'toProtoMessage' method, by first
    copying the internal list of blocks inside a read-lock, prior to
    serialisation (still outside the lock, to maximise concurrency). Since
    we only make a shallow copy, this should be fast and take no more than a
    MB or so of extra memory.
    
    This prevents a race seen to cause a ConcurrentModificationException
    during store persistence, that sometimes occurred when the application
    resumed from a long suspension.
    stejbac committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    02ee5bc View commit details
    Browse the repository at this point in the history
  2. Simplify & optimise BurningManAccountingStore.purgeLastTenBlocks

    Remove the last 10 blocks one-by-one from the end of the internal linked
    list of blocks, instead of rebuilding a truncated list from scratch.
    (This all takes place within a write-lock anyway, so it's atomic.)
    stejbac committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    0214566 View commit details
    Browse the repository at this point in the history