Skip to content
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

Concurrent map read/writes while running beacon-chain #5576

Closed
AlexSSD7 opened this issue Apr 22, 2020 · 8 comments
Closed

Concurrent map read/writes while running beacon-chain #5576

AlexSSD7 opened this issue Apr 22, 2020 · 8 comments
Labels
Need-Info Need more information from author

Comments

@AlexSSD7
Copy link

AlexSSD7 commented Apr 22, 2020

🐞 Bug Report

Description

Runtime panic caused by concurrent map read/writes. This issue can be resolved by using mutex.

Has this worked before in a previous version?

Can't gather information. It is pretty rare issue.

🔬 Minimal Reproduction

I was just very lucky to have two goroutines reading/writing values from single map. Would be very hard to reproduce.

🔥 Error


[2020-04-22 08:48:30]  INFO blockchain: Finished applying state transition attestations=19 attesterSlashings=0 deposits=0 proposerSlashings=0 slot=31440 voluntaryExits=0
[2020-04-22 08:48:30]  INFO sync: Processed pending block and cleared it in cache blockRoot=8149d9eb3741 slot=31440
[2020-04-22 08:48:30]  INFO blockchain: Executing state transition on block root=0x9ca85155... slot=31441
[2020-04-22 08:48:30]  INFO blockchain: Finished applying state transition attestations=10 attesterSlashings=0 deposits=0 proposerSlashings=0 slot=31441 voluntaryExits=0
[2020-04-22 08:48:30]  INFO sync: Processed pending block and cleared it in cache blockRoot=9ca85155ebee slot=31441
[2020-04-22 08:48:33]  INFO sync: Verified and saved pending attestations to pool blockRoot=9ca85155ebee pendingAttsCount=4
fatal error: concurrent map read and map write

// Panic (https://pastebin.com/ffJQzRrL)

🌍 Your Environment

Operating System:

  
        Ubuntu 18.04 Server (5.3.0-46-generic)
  

What version of Prysm are you running? (Which release)

  
        beacon-chain version Prysm/Git commit: 1224e75ba1af59d5ed074db766d0bd4e9b77ea64. Built at: 2020-04-18 10:50:26+00:00 (Docker image)
  

Anything else relevant (validator index / public key)?

Not neccesary.

@AlexSSD7
Copy link
Author

AlexSSD7 commented Apr 22, 2020

Duplicate of #5513, still not fixed.

@nisdas
Copy link
Member

nisdas commented Apr 22, 2020

Hey @AlexSSD7 , from your report the commit hash is 4 days old so it is an old image. This was fixed here, #5554, which was only merged in yesterday. Could you pull the latest and try again ?

@AlexSSD7
Copy link
Author

Oh, apparently I didn't notice it the date. Anyway I've upgraded the prysm version on my server. Left it running for couple days, will see if it is fixed.

@terencechain terencechain added the Need-Info Need more information from author label Apr 22, 2020
@terencechain
Copy link
Member

Thanks @AlexSSD7 , please give us an update

@prestonvanloon
Copy link
Member

There have been two releases since 1224e75. This has almost certainly been fixed. I'll close but please reopen if you have continued issues.

@stefa2k
Copy link

stefa2k commented Jun 27, 2020

I might have the same issue, running docker tag HEAD-1dfeb6 with this setup:

and log (Kibana export):
panic.LOG
2nd occasion:
panic2.LOG

I got "fatal error: concurrent map read and map write" 17 times in my logs after I started using haproxy as reverse proxy between the components beacon-chain, validator and geth.

@prestonvanloon
Copy link
Member

Thanks @stefa2k. The problem in your log is this bit of code:

if !s.connectedRPCClients[clientInfo.Addr] {
log.WithFields(logrus.Fields{
"addr": clientInfo.Addr.String(),
}).Infof("New gRPC client connected to beacon node")
s.connectedRPCClients[clientInfo.Addr] = true
}

connectedRPCClients map is accessed without a lock. I'll file a new issue for this, rather than resurrect this old one.

@prestonvanloon
Copy link
Member

New issue filed #6434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need-Info Need more information from author
Projects
None yet
Development

No branches or pull requests

5 participants