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

graph 崩溃(concurrent map read and map write) #32

Open
freedomkk-qfeng opened this issue Nov 8, 2016 · 2 comments
Open

graph 崩溃(concurrent map read and map write) #32

freedomkk-qfeng opened this issue Nov 8, 2016 · 2 comments

Comments

@freedomkk-qfeng
Copy link

用的是最新版本的代码(gitversion 2d27dc2
长期运行一直很稳定,今天凌晨意外崩溃了。。
可能和当时磁盘IO偏高有关
日志显示这样:

fatal error: concurrent map read and map write

goroutine 61213088 [running]:
runtime.throw(0x86725a, 0x21)
/usr/local/go/src/runtime/panic.go:566 +0x95 fp=0xc438085250 sp=0xc438085230
runtime.mapaccess2(0x7e6e60, 0xc42000d650, 0xc4399b9ac0, 0xc4380852e0, 0xc4380852e0)
/usr/local/go/src/runtime/hashmap.go:340 +0x249 fp=0xc438085298 sp=0xc438085250
reflect.mapaccess(0x7e6e60, 0xc42000d650, 0xc4399b9ac0, 0xc42000d650)
/usr/local/go/src/runtime/hashmap.go:1008 +0x3f fp=0xc4380852d0 sp=0xc438085298
reflect.Value.MapIndex(0x7e6e60, 0xc420088220, 0x195, 0x7c6f20, 0xc4399b9ac0, 0x98, 0x7dcc40, 0xc4399b9af0, 0x94)
/usr/local/go/src/reflect/value.go:1040 +0x128 fp=0xc438085358 sp=0xc4380852d0
encoding/json.(*mapEncoder).encode(0xc42012c208, 0xc42032e0b0, 0x7e6e60, 0xc420088220, 0x195, 0x100)
/usr/local/go/src/encoding/json/encode.go:646 +0x4f0 fp=0xc4380854b0 sp=0xc438085358
encoding/json.(*mapEncoder).(encoding/json.encode)-fm(0xc42032e0b0, 0x7e6e60, 0xc420088220, 0x195, 0x100)
/usr/local/go/src/encoding/json/encode.go:662 +0x64 fp=0xc4380854f0 sp=0xc4380854b0
encoding/json.(*structEncoder).encode(0xc420418ba0, 0xc42032e0b0, 0x83a420, 0xc4200881c0, 0x199, 0x100)
/usr/local/go/src/encoding/json/encode.go:601 +0x253 fp=0xc438085650 sp=0xc4380854f0
encoding/json.(*structEncoder).(encoding/json.encode)-fm(0xc42032e0b0, 0x83a420, 0xc4200881c0, 0x199, 0xc420080100)
/usr/local/go/src/encoding/json/encode.go:615 +0x64 fp=0xc438085690 sp=0xc438085650
encoding/json.(*ptrEncoder).encode(0xc42012c210, 0xc42032e0b0, 0x827500, 0xc4200881c0, 0x16, 0x820100)
/usr/local/go/src/encoding/json/encode.go:742 +0xe3 fp=0xc4380856d0 sp=0xc438085690
encoding/json.(*ptrEncoder).(encoding/json.encode)-fm(0xc42032e0b0, 0x827500, 0xc4200881c0, 0x16, 0xc420080100)
/usr/local/go/src/encoding/json/encode.go:747 +0x64 fp=0xc438085710 sp=0xc4380856d0
encoding/json.(*encodeState).reflectValue(0xc42032e0b0, 0x827500, 0xc4200881c0, 0x16, 0xc420080100)
/usr/local/go/src/encoding/json/encode.go:307 +0x82 fp=0xc438085748 sp=0xc438085710
encoding/json.interfaceEncoder(0xc42032e0b0, 0x7dcc40, 0xc42e1b02a0, 0x194, 0x7d0100)
/usr/local/go/src/encoding/json/encode.go:573 +0xdb fp=0xc438085788 sp=0xc438085748
encoding/json.(*arrayEncoder).encode(0xc42012c1a8, 0xc42032e0b0, 0x7bfa40, 0xc4416efaa0, 0x97, 0x100)
/usr/local/go/src/encoding/json/encode.go:723 +0xee fp=0xc4380857e0 sp=0xc438085788
encoding/json.(*arrayEncoder).(encoding/json.encode)-fm(0xc42032e0b0, 0x7bfa40, 0xc4416efaa0, 0x97, 0x100)
/usr/local/go/src/encoding/json/encode.go:730 +0x64 fp=0xc438085820 sp=0xc4380857e0
encoding/json.(*sliceEncoder).encode(0xc42012c1b0, 0xc42032e0b0, 0x7bfa40, 0xc4416efaa0, 0x97, 0x7b0100)
/usr/local/go/src/encoding/json/encode.go:697 +0xc1 fp=0xc438085860 sp=0xc438085820
encoding/json.(*sliceEncoder).(encoding/json.encode)-fm(0xc42032e0b0, 0x7bfa40, 0xc4416efaa0, 0x97, 0xc4416e0100)
/usr/local/go/src/encoding/json/encode.go:709 +0x64 fp=0xc4380858a0 sp=0xc438085860
encoding/json.(*encodeState).reflectValue(0xc42032e0b0, 0x7bfa40, 0xc4416efaa0, 0x97, 0xc4416e0100)
/usr/local/go/src/encoding/json/encode.go:307 +0x82 fp=0xc4380858d8 sp=0xc4380858a0
encoding/json.interfaceEncoder(0xc42032e0b0, 0x7dcc40, 0xc4416efcb0, 0x94, 0x100)
/usr/local/go/src/encoding/json/encode.go:573 +0xdb fp=0xc438085918 sp=0xc4380858d8
encoding/json.(*structEncoder).encode(0xc420418a20, 0xc42032e0b0, 0x802880, 0xc4416efca0, 0x99, 0x800100)
/usr/local/go/src/encoding/json/encode.go:601 +0x253 fp=0xc438085a78 sp=0xc438085918
encoding/json.(*structEncoder).(encoding/json.encode)-fm(0xc42032e0b0, 0x802880, 0xc4416efca0, 0x99, 0xc4416e0100)
/usr/local/go/src/encoding/json/encode.go:615 +0x64 fp=0xc438085ab8 sp=0xc438085a78
encoding/json.(*encodeState).reflectValue(0xc42032e0b0, 0x802880, 0xc4416efca0, 0x99, 0x100)
/usr/local/go/src/encoding/json/encode.go:307 +0x82 fp=0xc438085af0 sp=0xc438085ab8
encoding/json.(*encodeState).marshal(0xc42032e0b0, 0x802880, 0xc4416efca0, 0x100, 0x0, 0x0)
/usr/local/go/src/encoding/json/encode.go:280 +0xb8 fp=0xc438085b28 sp=0xc438085af0
encoding/json.Marshal(0x802880, 0xc4416efca0, 0x20, 0xc4204d2401, 0xc4416efca0, 0xc42bde3bd0, 0x41131b)
/usr/local/go/src/encoding/json/encode.go:145 +0x8f fp=0xc438085b70 sp=0xc438085b28
github.com/open-falcon/graph/http.RenderJson(0xc3d3e0, 0xc4287aa410, 0x802880, 0xc4416efca0)
/usr/local/gopath/src/github.com/open-falcon/graph/http/http.go:32 +0x39 fp=0xc438085bd0 sp=0xc438085b70
github.com/open-falcon/graph/http.RenderDataJson(0xc3d3e0, 0xc4287aa410, 0x7bfa40, 0xc4416efaa0)
/usr/local/gopath/src/github.com/open-falcon/graph/http/http.go:42 +0xb4 fp=0xc438085c28 sp=0xc438085bd0
github.com/open-falcon/graph/http.configProcRoutes.func2(0xc3d3e0, 0xc4287aa410, 0xc4336d50e0)
/usr/local/gopath/src/github.com/open-falcon/graph/http/proc_http.go:20 +0x92 fp=0xc438085c78 sp=0xc438085c28
net/http.HandlerFunc.ServeHTTP(0x893c08, 0xc3d3e0, 0xc4287aa410, 0xc4336d50e0)
/usr/local/go/src/net/http/server.go:1726 +0x44 fp=0xc438085ca0 sp=0xc438085c78
net/http.(*ServeMux).ServeHTTP(0xc53c40, 0xc3d3e0, 0xc4287aa410, 0xc4336d50e0)
/usr/local/go/src/net/http/server.go:2022 +0x7f fp=0xc438085ce0 sp=0xc438085ca0
net/http.serverHandler.ServeHTTP(0xc420138100, 0xc3d3e0, 0xc4287aa410, 0xc4336d50e0)
/usr/local/go/src/net/http/server.go:2202 +0x7d fp=0xc438085d28 sp=0xc438085ce0
net/http.(*conn).serve(0xc42badfc80, 0xc3de60, 0xc45161aec0)
/usr/local/go/src/net/http/server.go:1579 +0x4b7 fp=0xc438085f88 sp=0xc438085d28
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc438085f90 sp=0xc438085f88
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2293 +0x44d

@laiwei
Copy link
Contributor

laiwei commented Nov 8, 2016

这是个好问题啊,看起来和http的统计接口有关,稍等看看

@shaofuzhang
Copy link

这个问题有什么后续嘛?我们也遇到这种问题,graph运行一段时间会出这个问题

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

No branches or pull requests

3 participants