-
Notifications
You must be signed in to change notification settings - Fork 187
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
encounter concurrent map writes issue #471
Comments
Are you invoking methods in the router directly?
You should never do that; the maps are only accessed in the event loop
thread.
…On Mon, Jan 17, 2022, 04:49 wanmingchao001 ***@***.***> wrote:
In GossipSubRouter these are many thread-unsafe maps, such as peers,
direct, etc. I forked this project (v0.3.5) and it panic randomly due to concurrent
map writes issue. Plz see the detail as follows.
fatal error: concurrent map writes
goroutine 602 [running]:
runtime.throw(0x262c7fd, 0x15)
/usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc01db9b5c0
sp=0xc01db9b590 pc=0x4ff272
runtime.mapdelete_faststr(0x22355a0, 0xc00f8b1410, 0xc00fb7e5a0, 0x22)
/usr/local/go/src/runtime/map_faststr.go:377 +0x34c fp=0xc01db9b628
sp=0xc01db9b5c0 pc=0x4dc06c
chainmaker.org/chainmaker/libp2p-pubsub.(*GossipSubRouter).RemovePeer(0xc00f97e000,
0xc00fb7e5a0, 0x22)
/root/gocode/pkg/mod/
***@***.***/gossipsub.go:483 +0x138
fp=0xc01db9b700 sp=0xc01db9b628 pc=0x16d1e18
chainmaker.org/chainmaker/libp2p-pubsub.(*PubSub).processLoop(0xc0002da1a0,
0x2a19a00, 0xc000044118)
/root/gocode/pkg/mod/
***@***.***/pubsub.go:615 +0x1759
fp=0xc01db9bfc8 sp=0xc01db9b700 pc=0x16e4639
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc01db9bfd0
sp=0xc01db9bfc8 pc=0x538661
created by chainmaker.org/chainmaker/libp2p-pubsub.NewPubSub
/root/gocode/pkg/mod/
***@***.***/pubsub.go:296 +0xc09
It seems that when removing peer from the peers map, other go routine
reads it.
Does anyone see the same problem?
—
Reply to this email directly, view it on GitHub
<#471>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAI4SRN62E2BGCHN6J4TELUWN7STANCNFSM5MDSITXQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@vyzo I got it. I invoked the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
GossipSubRouter
these are many thread-unsafe maps, such aspeers, direct
, etc.I forked this project (v0.3.5) and it panic randomly due to
concurrent map writes issue
. Plz see the detail as follows.It seems that when removing peer from the
peers
map, other go routine reads it.Does anyone see the same problem?
The text was updated successfully, but these errors were encountered: