aligned_layer
aligned_layer copied to clipboard
bug(aggregator): add `taskMutex` protection to `ClearTasksFromMap` go routine.
The taskMutex mutex is used in the aggregator to protect the batchesIdxByIdentifierHash, batchCreatedBlockByIdx, batchesIdentifierHashByIdx and batchDataByIdentifierHash internal maps, as well as the and nextBatchIndex variable.
Some of those structures are being modified inside the ClearTasksFromMap function, which runs on a separated go routine, without using the taskMutex.
Also, documentation of taskMutex should be updated to reflect all structures that it's protecting.