This error indicates that there were simultaneous read and write operations on the filter.addrs map, leading to a race condition.
Solution:
To resolve this issue, I implemented the following changes:
Moved SyncMap to erigon-lib common library: This allows us to utilize a thread-safe map across different packages that require synchronized map access.
Refactored logsFilter to use SyncMap: By replacing the standard map with SyncMap, we ensured that all map operations are thread-safe, thus preventing concurrent read and write errors.
Added documentation for SyncMap usage: Detailed documentation was provided to guide the usage of SyncMap and related refactored components, ensuring clarity and proper utilization.
relates to https://github.com/erigontech/erigon/issues/11890 cherry pick from E3 2f2ce6afaa67d6d013bf7d785ed88557e8a9cc21
Issue:
At line 129 in
logsfilter.go
, we had the following line of code:This line caused a panic due to a fatal error:
This error indicates that there were simultaneous read and write operations on the
filter.addrs
map, leading to a race condition.Solution:
To resolve this issue, I implemented the following changes: