delimitrou / DeathStarBench

Open-source benchmark suite for cloud microservices
Apache License 2.0
752 stars 419 forks source link

hotel: Sporadic panic in microservice geo #243

Closed lianhao closed 1 year ago

lianhao commented 2 years ago

Sporadically we found panic in hotel geo microservice due to a bug in upstream github.com/hailocab/go-geoindex

fatal error: concurrent map writes

goroutine 75 [running]: runtime.throw({0x9508aa, 0x0}) /usr/local/go/src/runtime/panic.go:1198 +0x71 fp=0xc0004a7320 sp=0xc0004a72f0 pc=0x434f71 runtime.mapassign_fast64(0x9f8e10, 0xc000302940, 0x17b) /usr/local/go/src/runtime/map_fast64.go:101 +0x2c5 fp=0xc0004a7358 sp=0xc0004a7320 pc=0x412ce5 github.com/hailocab/go-geoindex.lonDegreeDistance.get(0x0, 0x8) /go/src/github.com/harlow/go-micro-services/vendor/github.com/hailocab/go-geoindex/point.go:122 +0xfb fp=0xc0004a73b0 sp=0xc0004a7358 pc=0x80c05b github.com/hailocab/go-geoindex.approximateSquareDistance({0x9f8e70, 0xc0004c0220}, {0x9f8e10, 0xc000302900}) /go/src/github.com/harlow/go-micro-services/vendor/github.com/hailocab/go-geoindex/point.go:137 +0xf6 fp=0xc0004a73f8 sp=0xc0004a73b0 pc=0x80c196 github.com/hailocab/go-geoindex.(sortedPoints).Less(0xc00032f710, 0x8c9f80, 0x0) /go/src/github.com/harlow/go-micro-services/vendor/github.com/hailocab/go-geoindex/points-index.go:146 +0x50 fp=0xc0004a7430 sp=0xc0004a73f8 pc=0x80ceb0 sort.insertionSort({0x9f8e40, 0xc00032f710}, 0x0, 0x6) /usr/local/go/src/sort/sort.go:40 +0xb1 fp=0xc0004a7470 sp=0xc0004a7430 pc=0x4a9551 sort.quickSort({0x9f8e40, 0xc00032f710}, 0x28, 0x8df460, 0xc000356501) /usr/local/go/src/sort/sort.go:222 +0x171 fp=0xc0004a74d0 sp=0xc0004a7470 pc=0x4aa031 sort.Sort({0x9f8e40, 0xc00032f710}) /usr/local/go/src/sort/sort.go:231 +0x53 fp=0xc0004a7508 sp=0xc0004a74d0 pc=0x4aa0d3 github.com/hailocab/go-geoindex.(PointsIndex).KNearest(0xc0004b30e0, {0x9f8e10, 0xc000302900}, 0x5, 0x40c3880000000000, 0x30) /go/src/github.com/harlow/go-micro-services/vendor/github.com/hailocab/go-geoindex/points-index.go:185 +0x5d0 fp=0xc0004a7760 sp=0xc0004a7508 pc=0x80d510 github.com/hailocab/go-geoindex.(ClusteringIndex).KNearest(...) /go/src/github.com/harlow/go-micro-services/vendor/github.com/hailocab/go-geoindex/clustering-index.go:75 github.com/harlow/go-micro-services/services/geo.(Server).getNearbyPoints(0xc0004702d0, {0x7fbe443b07d0, 0x40b32d}, 0x4042fbe760000000, 0xc05e82c080000000) /go/src/github.com/harlow/go-micro-services/services/geo/server.go:144 +0x87 fp=0xc0004a77a0 sp=0xc0004a7760 pc=0x810c07 github.com/harlow/go-micro-services/services/geo.(Server).Nearby(0x94c671, {0x9fbb20, 0xc00032f6b0}, 0x931120) /go/src/github.com/harlow/go-micro-services/services/geo/server.go:121 +0x3e fp=0xc0004a7828 sp=0xc0004a77a0 pc=0x810a1e github.com/harlow/go-micro-services/services/geo/proto._Geo_Nearby_Handler.func1({0x9fbb20, 0xc00032f6b0}, {0x8ee3e0, 0xc000029100}) /go/src/github.com/harlow/go-micro-services/services/geo/proto/geo.pb.go:138 +0x78 fp=0xc0004a7868 sp=0xc0004a7828 pc=0x810238 github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x9fbb20, 0xc00032f5c0}, {0x8ee3e0, 0xc000029100}, 0xc000302880, 0xc00000eb28) /go/src/github.com/harlow/go-micro-services/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/server.go:61 +0x478 fp=0xc0004a7a88 sp=0xc0004a7868 pc=0x809358 github.com/harlow/go-micro-services/services/geo/proto._Geo_Nearby_Handler({0x8d9860, 0xc0004702d0}, {0x9fbb20, 0xc00032f5c0}, 0xc0001fc310, 0xc0004c0760) /go/src/github.com/harlow/go-micro-services/services/geo/proto/geo.pb.go:140 +0x138 fp=0xc0004a7ae0 sp=0xc0004a7a88 pc=0x8100f8 google.golang.org/grpc.(Server).processUnaryRPC(0xc00044c2c0, {0xa02000, 0xc0005c2180}, 0xc0002b2b40, 0xc0004ceab0, 0xd24950, 0x0) /go/src/github.com/harlow/go-micro-services/vendor/google.golang.org/grpc/server.go:920 +0xddf fp=0xc0004a7e40 sp=0xc0004a7ae0 pc=0x7fde7f google.golang.org/grpc.(Server).handleStream(0xc00044c2c0, {0xa02000, 0xc0005c2180}, 0xc0002b2b40, 0x0) /go/src/github.com/harlow/go-micro-services/vendor/google.golang.org/grpc/server.go:1142 +0xdfe fp=0xc0004a7f68 sp=0xc0004a7e40 pc=0x80151e google.golang.org/grpc.(Server).serveStreams.func1.1() /go/src/github.com/harlow/go-micro-services/vendor/google.golang.org/grpc/server.go:637 +0x98 fp=0xc0004a7fe0 sp=0xc0004a7f68 pc=0x7fc358 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0004a7fe8 sp=0xc0004a7fe0 pc=0x464641 created by google.golang.org/grpc.(*Server).serveStreams.func1 /go/src/github.com/harlow/go-micro-services/vendor/google.golang.org/grpc/server.go:635 +0xef