-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Expression evaluation code is not goroutine-safe #127
Comments
|
|
In an IM, Matt writes:
We're still in exploratory mode, but I'll definitely do this long-term. The context here is getting instantaneous values for the purposes of alerting. A "rule" is a precomputed expression? (Where does the "rule" terminology come from?) A side-question I was going to raise later is: how do I construct an expression to get a scalar value (say average) over a certain time window? "Windowing" is exposed in the Graph UI as Range, but not in the expression grammar or query API as far as I could tell. |
Right, this is a known caveat still and I just didn't think anyone would hit it that early on in the experimental phase: https://github.com/prometheus/prometheus/blob/master/rules/load.go#L25 I'll prioritize this. |
Yeah, quite impressive, since the parsing time should be so negligibly small compared to the rest of the expression evaluation that it should be quite hard to trigger this condition under normal circumstances. In fact, I haven't managed to recreate it yet with 4 parallel curls, but they are probably just too slow. I think I'll just wrap the entire parser in a lock, since goyacc/golex don't give me much better options :-/ |
Document hashmod
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
To reproduce, create a small program which launches concurrent requests to
prometheus/api/query?json=JSON&expr=<anything>
. Each request will have one of three possible outcomes:For the record, the panic has this stacktrace:
The text was updated successfully, but these errors were encountered: