-
Notifications
You must be signed in to change notification settings - Fork 129
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
Race Condition in Network Package Causes Gossamer to Crash #2393
Comments
I had a feeling that it could be because of a race condition is For example, gossamer/dot/network/peersdata.go Lines 35 to 39 in 5843324
I think differs runs before return statements. (https://www.digitalocean.com/community/tutorials/understanding-defer-in-go, https://medium.com/a-journey-with-go/go-how-does-defer-statement-work-1a9492689b6e) So, we are locking and unlocking before the task interesting to us. We should do something like this func (p *peersData) getMutex(peerID peer.ID) *sync.Mutex {
p.mutexesMu.RLock()
defer p.mutexesMu.RUnlock()
- return p.mutexes[peerID]
+
+ mtx := p.mutexes[peerID]
+ return mtx
} Same goes for getInboundHandshakeData, getOutboundHandshakeData. I ran the network after fixing this, but I still saw the problem. But this does seem inappropriate and we should fix this. |
closed in #2393 |
Fixed by #2408 |
Describe the bug
runtime: unknown pc
error.Expected Behavior
Current Behavior
Possible Solution
To Reproduce
Steps to reproduce the behaviour:
( Look at https://hackmd.io/@nZ-twauPRISEa6G9zg3XRw/B1RFO3uDt for devnet setup)
Log output
https://gist.github.com/kishansagathiya/395cb914ce338e6081a73d58c51527f6
Specification
The text was updated successfully, but these errors were encountered: