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

Fix concurrency write map panic #338

Merged
merged 4 commits into from
Dec 17, 2021
Merged

Conversation

winwill2012
Copy link
Contributor

Fix concurrency write map panic:

fatal error: concurrent map read and map write

goroutine 163 [running]:
runtime.throw({0x109be48, 0xf5ae00})
/usr/local/go/src/runtime/panic.go:1198 +0x71 fp=0xc0041e0630 sp=0xc0041e0600 pc=0x435bf1
runtime.mapaccess2_faststr(0xc003c2e5e8, 0x26, {0x107e883, 0x7})
/usr/local/go/src/runtime/map_faststr.go:116 +0x3d4 fp=0xc0041e0698 sp=0xc0041e0630 pc=0x412db4
github.com/zhenghaoz/gorse/worker.(*Worker).exploreRecommend(0xc00025e000, {0xc00bad2c00, 0x28, 0x28}, 0x1089476, {0xc000f2ba00, 0xf})
/Users/mac/code/gorse/worker/worker.go:713 +0x90 fp=0xc0041e07a0 sp=0xc0041e0698 pc=0xe68350
github.com/zhenghaoz/gorse/worker.(*Worker).Recommend.func2(0x0, 0x7ffb)
/Users/mac/code/gorse/worker/worker.go:602 +0x2e35 fp=0xc0041e1f48 sp=0xc0041e07a0 pc=0xe65c95
github.com/zhenghaoz/gorse/base.Parallel.func2(0x0)
/Users/mac/code/gorse/base/parallel.go:67 +0xc4 fp=0xc0041e1fc8 sp=0xc0041e1f48 pc=0x78e824
github.com/zhenghaoz/gorse/base.Parallel·dwrap·1()
/Users/mac/code/gorse/base/parallel.go:72 +0x2d fp=0xc0041e1fe0 sp=0xc0041e1fc8 pc=0x78e72d
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0041e1fe8 sp=0xc0041e1fe0 pc=0x468401
created by github.com/zhenghaoz/gorse/base.Parallel
/Users/mac/code/gorse/base/parallel.go:57 +0x130

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2021

Codecov Report

Merging #338 (31a7018) into master (d7d9d35) will decrease coverage by 0.05%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
- Coverage   72.99%   72.94%   -0.06%     
==========================================
  Files          44       44              
  Lines        9109     9118       +9     
==========================================
+ Hits         6649     6651       +2     
- Misses       1752     1756       +4     
- Partials      708      711       +3     
Impacted Files Coverage Δ
config/config.go 93.87% <77.77%> (-1.05%) ⬇️
worker/worker.go 62.75% <100.00%> (ø)
master/task_manager.go 88.23% <0.00%> (-3.68%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7d9d35...31a7018. Read the comment docs.

@zhangzhenghao
Copy link
Collaborator

zhangzhenghao commented Dec 17, 2021

Thanks for your contribution 😁

config/config.go Outdated Show resolved Hide resolved
config/config_test.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
@zhangzhenghao zhangzhenghao merged commit 1412438 into gorse-io:master Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants