-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Panic in txpool with 2 sentries #4679
Comments
Great. Now we know that need 2 sentries to reproduce it. |
Same as I made the same mistake in go-ethereum recently. Fix: ethereum/go-ethereum#26164 |
Oh, I see. We'll fix it. @holiman thank you for pointing this out! |
[simplelru](https://github.com/hashicorp/golang-lru/tree/master/simplelru) is not thread safe. During the `Get` operation, the recentness of the accessed item is updated, so it is not a pure read-operation. Therefore, the mutex we need to protect the LRUs in txpool is a full mutex, not `RLock`. See erigontech/erigon#4679 (comment) and ethereum/go-ethereum#26164. Also, RWMutex has a performance overhead compared with the vanilla one (see, for example, golang/go#38813). Kudos to Martin Swende for pointing to the issue.
When I set up 2 sentries (
backend.sentryServers
in eth/backend.go), after some time Erigon crashes withThe text was updated successfully, but these errors were encountered: