-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Query: panic on api.Respond warn.Error() #4777
Comments
Signed-off-by: ian woolf <btw515wolf2@gmail.com>
@hanjm I'm investigate the root cause. I notice the project path is |
No. I use official image,so the path is ci path. |
Signed-off-by: Jimmiehan <hanjinming@outlook.com>
Signed-off-by: Jimmiehan <hanjinming@outlook.com>
I found it.
// GetInstr returns a http HandlerFunc with the instrumentation middleware.
func GetInstr(
tracer opentracing.Tracer,
logger log.Logger,
ins extpromhttp.InstrumentationMiddleware,
logMiddleware *logging.HTTPServerMiddleware,
disableCORS bool,
) InstrFunc {
instr := func(name string, f ApiFunc) http.HandlerFunc {
hf := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if !disableCORS {
SetCORS(w)
}
if data, warnings, err := f(r); err != nil {
RespondError(w, err, data)
} else if data != nil {
// TODO temp debug code
var warningsNew []error
for i, warn := range warnings {
if warn == nil {
level.Error(logger).Log("msg", fmt.Sprintf("warn(%d) is nil, path:%s,"+
"data:%+v, warnings:%v",
i, r.RequestURI, data, warnings))
} else {
warningsNew = append(warningsNew, warn)
}
}
Respond(w, data, warningsNew)
} else {
w.WriteHeader(http.StatusNoContent)
}
})
{"caller":"api.go:218","level":"error","msg":"warn is nil, path:/api/v1/query_exemplars?query=sum(cur_distribute_num%7Bapp%3D%27diff%27%7D)&start=1635218940&end=1635305340,data:[], warnings:[receiving exemplars from exemplars client &{0xc000e8aa80}: rpc error: code = Unimplemented desc = unknown service thanos.Exemplars\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsServer).Send\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/exemplars.go:44\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsStream).receive\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:191\ngithub.com/thanos-io/thanos/pkg/exemplars.(*Proxy).Exemplars.func1\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:133\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/Users/jimmiehan/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go117/src/runtime/asm_amd64.s:1581 receiving exemplars from exemplars client &{0xc000d70e00}: rpc error: code = Unimplemented desc = unknown service thanos.Exemplars\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsServer).Send\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/exemplars.go:44\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsStream).receive\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:191\ngithub.com/thanos-io/thanos/pkg/exemplars.(*Proxy).Exemplars.func1\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:133\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/Users/jimmiehan/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go117/src/runtime/asm_amd64.s:1581 receiving exemplars from exemplars client &{0xc000dca700}: rpc error: code = Unimplemented desc = unknown service thanos.Exemplars\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsServer).Send\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/exemplars.go:44\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsStream).receive\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:191\ngithub.com/thanos-io/thanos/pkg/exemplars.(*Proxy).Exemplars.func1\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:133\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/Users/jimmiehan/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go117/src/runtime/asm_amd64.s:1581 receiving exemplars from exemplars client &{0xc0000dbc00}: rpc error: code = Unimplemented desc = unknown service thanos.Exemplars\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsServer).Send\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/exemplars.go:44\ngithub.com/thanos-io/thanos/pkg/exemplars.(*exemplarsStream).receive\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:191\ngithub.com/thanos-io/thanos/pkg/exemplars.(*Proxy).Exemplars.func1\n\t/Users/jimmiehan/github.com/hanjm/thanos/pkg/exemplars/proxy.go:133\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/Users/jimmiehan/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go117/src/runtime/asm_amd64.s:1581 receiving exemplars from exemplars client &{0xc000cb0380}: rpc error: code = Unimplemented desc = unknown service thanos.Exemplars\ngithub.com/thanos-io/thanos/pkg/exemp
|
Signed-off-by: Jimmiehan <hanjinming@outlook.com>
Signed-off-by: Jimmiehan <hanjinming@outlook.com>
👍 |
Signed-off-by: ian woolf <btw515wolf2@gmail.com>
Signed-off-by: ian woolf <btw515wolf2@gmail.com>
Signed-off-by: ian woolf <btw515wolf2@gmail.com>
@GiedriusS Append slice concurrently is unsafe, I guess it is relevent. I can reproduce it, as is a data race, it is not a stable bug, need run multi times
I search in google and find this post https://groups.google.com/g/golang-nuts/c/pNuplOvIeWA ,
|
* Query: add exemplarsServer data race test (thanos-io#4777) Signed-off-by: Jimmiehan <hanjinming@outlook.com> * Query: fix exemplarsServer data race (thanos-io#4777) Signed-off-by: Jimmiehan <hanjinming@outlook.com>
Thanos, Prometheus and Golang version used:
Thanos main-2021-10-13-f8927b9a
Object Storage Provider:
What happened:
thanos query omit panic log
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
May take time to futher investigate.
Full logs to relevant components:
Anything else we need to know:
The text was updated successfully, but these errors were encountered: