aligned_layer icon indicating copy to clipboard operation
aligned_layer copied to clipboard

Refactor aggregator internal structures concurrency control

Open JulianVentura opened this issue 1 year ago • 0 comments

The aggregator has the following structures that are read and written concurrently:

  • batchesIdxByIdentifierHash
  • batchCreatedBlockByIdx
  • batchesIdentifierHashByIdx
  • batchDataByIdentifierHash
  • nextBatchIndex

Access to them is being achieved with the taskMutex, but current implementation is error-prone, since it's easy to forget the usage of the mutex to access the structures, as seen in #1416.

We should refactor this logic, by encapsulating the access to these internal structures in a new structure which allows accessing in a concurrent safe manner, by using the mutex internally.

JulianVentura avatar Nov 13 '24 21:11 JulianVentura