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

fatal error: concurrent map read and map write #166

Closed
kelly6 opened this issue Aug 21, 2019 · 7 comments · May be fixed by #1141
Closed

fatal error: concurrent map read and map write #166

kelly6 opened this issue Aug 21, 2019 · 7 comments · May be fixed by #1141
Labels
bug Something isn't working

Comments

@kelly6
Copy link
Contributor

kelly6 commented Aug 21, 2019

branch:origin/native

I start 12 clients with the same group, Some clients crashed after a few minutes.
Here is its traceback:

fatal error: concurrent map read and map write

goroutine 52 [running]:
runtime.throw(0x5e51b9, 0x21)
    /usr/lib/go/src/runtime/panic.go:617 +0x72 fp=0xc001cebcd8 sp=0xc001cebca8 pc=0x42ce92
runtime.mapaccess1_faststr(0x5a3f60, 0xc00145e2d0, 0x5df7c4, 0xa, 0xc0002760d0)
    /usr/lib/go/src/runtime/map_faststr.go:21 +0x469 fp=0xc001cebd48 sp=0xc001cebcd8 pc=0x4134c9
github.com/apache/rocketmq-client-go/consumer.(*processQueue).putMessage(0xc0002bcd00, 0xc00024c000, 0x1, 0x1)
    /home/kelly/code/git/rocketmq-client-go/consumer/process_queue.go:104 +0x221 fp=0xc001cebdd8 sp=0xc001cebd48 pc=0x568001
github.com/apache/rocketmq-client-go/consumer.(*pushConsumer).pullMessage(0xc0001cc9c0, 0xc0002880f0)
    /home/kelly/code/git/rocketmq-client-go/consumer/push_consumer.go:474 +0x1a2d fp=0xc001cebfb0 sp=0xc001cebdd8 pc=0x56bfbd
github.com/apache/rocketmq-client-go/consumer.(*pushConsumer).Start.func1.2.1(0xc0001cc9c0, 0xc0002880f0)
    /home/kelly/code/git/rocketmq-client-go/consumer/push_consumer.go:141 +0x35 fp=0xc001cebfd0 sp=0xc001cebfb0 pc=0x573725
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc001cebfd8 sp=0xc001cebfd0 pc=0x4584e1
created by github.com/apache/rocketmq-client-go/consumer.(*pushConsumer).Start.func1.2
    /home/kelly/code/git/rocketmq-client-go/consumer/push_consumer.go:140 +0x4a

test code:

examples/consumer/simple/main.go

@wenfengwang
Copy link
Member

the duplicated issue: #139

@kelly6
Copy link
Contributor Author

kelly6 commented Aug 23, 2019

the duplicated issue: #139

@wenfengwang
I'm not sure. The call stack looks a little different. #139 crashs in update.

Do these functions change the same map?

@ShannonDing ShannonDing added the discuss Something undering disscussing label Aug 23, 2019
@ShannonDing
Copy link
Member

@kelly6 Lock was added when local offset was updated in PR #164, Could you please have a test again in your ENV after PR #146 merged?

@wenfengwang
Copy link
Member

@ShannonDing @kelly6 It seems to my mistake. the issue #139 is an error that happened when access offset concurrently, but the issue is access message.Properties concurrently. so the issue is different from #139. I will fix it.

@kelly6
Copy link
Contributor Author

kelly6 commented Aug 23, 2019

@ShannonDing As @wenfengwang commented, those two issue may not be the same, I will run my test when he fix this.

@ShannonDing ShannonDing added bug Something isn't working and removed discuss Something undering disscussing labels Aug 23, 2019
@wenfengwang
Copy link
Member

fixed by #197

@ShannonDing
Copy link
Member

close due to #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants